Hi Michael,
On Thu, Oct 13, 2011 at 08:18:46AM +0200, michael.hennerich@analog.com wrote:
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.
--
Dmitry