Re: [Power-supply]: Error handling in max17042_battery.c

From: MyungJoo Ham
Date: Fri Aug 26 2011 - 02:32:41 EST


Sender : Pallala, Ramakrishna<ramakrishna.pallala@xxxxxxxxx> Date : 2011-08-26 14:46 (GMT+09:00)
> Hi All,
>
> I am working on the I2C based max17042 fuel gauge driver
> Which is drivers/power/max17042_battery.c
>
> In max17042_get_property(...), the values returned by
> Max17042_read_reg are directly assigned to the variables,
> even if the read results in an error. Shouldn't we check
> for the 'correctness' of the returned values and then
> assign them ? Can I submit a patch to change this ?
>
> Or Is this done intentionally ?
>
> Thanks,
> Ram
>

Hello,

I did not ignore and return the error values from max17042_read_reg() intentionally, I've just missed them somehow (maybe was too lazy that day?).

Handling errors from max17042_read_reg() at the side of max17042_get_property() is a feature missing. And, I'd be much appreciated if you'd send the patch you've mentioned.

Thank you,
MyungJooN떑꿩ìr¸›y鉉싕b²XФ푤vØ^–)頻{.nÇ+돴¥Š{±묎çzX㎍썳變}©옽Æ zÚ&j:+v돣¾«묎çzZ+€Ê+zf"·hš닱~넮녬iÿ鎬z¹®wⅱ¸?솳鈺Ú&¢)刪f뷌^j푹y§m끷@A«a뛴ÿ 0띠h®å’i