Thread (3 messages) flat view 3 messages, 2 authors, 2011-10-19

RE: [PATCH RESEND] input: keyboard: adp5589-keys: Add support for the ADP5585 derivatives

From: "Hennerich, Michael" <Michael.Hennerich@analog.com>
Date: 2011-10-19 07:09:59

Dmitry Torokhov wrote on 2011-10-19:
Hi Michael,

On Thu, Oct 13, 2011 at 08:18:46AM +0200, michael.hennerich@analog.com
wrote:
quoted
 static void __devinit adp5589_report_switch_state(struct adp5589_kpad
 *kpad) {
-    int gpi_stat1 = adp5589_read(kpad->client, ADP5589_GPI_STATUS_A);
-    int gpi_stat2 = adp5589_read(kpad->client, ADP5589_GPI_STATUS_B);
-    int gpi_stat3 = adp5589_read(kpad->client, ADP5589_GPI_STATUS_C);
-    int gpi_stat_tmp, pin_loc;
+    int gpi_stat_tmp, pin_loc, gpi_stat3;
     int i;
+    int gpi_stat1 = adp5589_read(kpad->client,
+                                 kpad->var->reg(ADP5589_GPI_STATUS_A));
+    int gpi_stat2 = adp5589_read(kpad->client,
+                                 kpad->var->reg(ADP5589_GPI_STATUS_B));
+    if (!kpad->is_adp5585)
+            gpi_stat3 = adp5589_read(kpad->client,
ADP5589_GPI_STATUS_C);

This cause my compiler to complain that gpi_stat3 might be used
uninitialized; I changed it to

      int gpi_stat3 = !kpad->is_adp5585 ?
                      adp5589_read(kpad->client, ADP5589_GPI_STATUS_C) : 0;

and applied.

Thanks.
That works - Thanks!

Greetings,
Michael

--
Analog Devices GmbH      Wilhelm-Wagenfeld-Str. 6      80807 Muenchen
Sitz der Gesellschaft: Muenchen; Registergericht: Muenchen HRB 40368;
Geschaeftsfuehrer:Dr.Carsten Suckrow, Thomas Wessel, William A. Martin, Margaret Seif

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help