diff options
Diffstat (limited to 'drivers/power/generic-adc-battery.c')
-rw-r--r-- | drivers/power/generic-adc-battery.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/power/generic-adc-battery.c b/drivers/power/generic-adc-battery.c index e902b088d52c..32ce17e235c0 100644 --- a/drivers/power/generic-adc-battery.c +++ b/drivers/power/generic-adc-battery.c | |||
@@ -279,7 +279,8 @@ static int gab_probe(struct platform_device *pdev) | |||
279 | } | 279 | } |
280 | 280 | ||
281 | memcpy(psy->properties, gab_props, sizeof(gab_props)); | 281 | memcpy(psy->properties, gab_props, sizeof(gab_props)); |
282 | properties = psy->properties + sizeof(gab_props); | 282 | properties = (enum power_supply_property *) |
283 | ((char *)psy->properties + sizeof(gab_props)); | ||
283 | 284 | ||
284 | /* | 285 | /* |
285 | * getting channel from iio and copying the battery properties | 286 | * getting channel from iio and copying the battery properties |
@@ -327,7 +328,7 @@ static int gab_probe(struct platform_device *pdev) | |||
327 | ret = request_any_context_irq(irq, gab_charged, | 328 | ret = request_any_context_irq(irq, gab_charged, |
328 | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, | 329 | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, |
329 | "battery charged", adc_bat); | 330 | "battery charged", adc_bat); |
330 | if (ret) | 331 | if (ret < 0) |
331 | goto err_gpio; | 332 | goto err_gpio; |
332 | } | 333 | } |
333 | 334 | ||