power-supply: Check for failures only when we can fail
authorViresh Kumar <viresh.kumar@linaro.org>
Thu, 4 Sep 2014 12:01:34 +0000 (17:31 +0530)
committerSebastian Reichel <sre@kernel.org>
Tue, 16 Sep 2014 09:01:37 +0000 (11:01 +0200)
commit73b4a087ba4c0d0d52519769320fa684185c563e
tree6d691c88248949913297077e71580460c0bc1f90
parent9d2410c79b5b2dd741648de26ad52ffd2ce3dc01
power-supply: Check for failures only when we can fail

In power_supply_show_property() routine, we call ->get_property() conditionally
and should check for failure in that case only. There is no point comparing
'ret' for errors when 'ret' is surely zero.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
drivers/power/power_supply_sysfs.c