spring: Fix a bug of PWM duty cycle upper bound
spring: Fix a bug of PWM duty cycle upper bound

The return value from battery_current() is non-zero if there's an error.

Also rewrite the condition to make it more readable.

BUG=None
TEST=Check PWM duty cycle can be set to 100%
BRANCH=Spring

Original-Change-Id: If13a295d87a1abd2e67f1bb216dc58d3f3d29ba4
Signed-off-by: Vic Yang <5fd92abeee651458f98e2856f4f200ee971cee4d@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/60735
Reviewed-by: Vincent Palatin <70a9964ec8fd10b0b08fcc8623c2add25ddf99ac@chromium.org>
(cherry picked from commit 29a157e5276a4f0ed004aaab365ad9e32b68c250)

Change-Id: I7383bfd49931c8555f92a74e5960bd7e40102fa6
Signed-off-by: Vic Yang <5fd92abeee651458f98e2856f4f200ee971cee4d@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/61398
Reviewed-by: Vincent Palatin <70a9964ec8fd10b0b08fcc8623c2add25ddf99ac@chromium.org>

akappy7/ChromeOS_EC_LED_Diagnostics,coreboot/chrome-ec,thehobn/ec,fourier49/BIZ_EC,thehobn/ec,gelraen/cros-ec,mtk09422/chromiumos-platform-ec,gelraen/cros-ec,alterapraxisptyltd/chromium-ec,eatbyte/chromium-ec,thehobn/ec,coreboot/chrome-ec,md5555/ec,longsleep/ec,md5555/ec,coreboot/chrome-ec,akappy7/ChromeOS_EC_LED_Diagnostics,alterapraxisptyltd/chromium-ec,fourier49/BIZ_EC,mtk09422/chromiumos-platform-ec,gelraen/cros-ec,eatbyte/chromium-ec,alterapraxisptyltd/chromium-ec,longsleep/ec,coreboot/chrome-ec,md5555/ec,thehobn/ec,gelraen/cros-ec,longsleep/ec,fourier49/BZ_DEV_EC,eatbyte/chromium-ec,coreboot/chrome-ec,fourier49/BIZ_EC,fourier49/BIZ_EC,akappy7/ChromeOS_EC_LED_Diagnostics,akappy7/ChromeOS_EC_LED_Diagnostics,alterapraxisptyltd/chromium-ec,eatbyte/chromium-ec,akappy7/ChromeOS_EC_LED_Diagnostics,fourier49/BZ_DEV_EC,coreboot/chrome-ec,fourier49/BZ_DEV_EC,mtk09422/chromiumos-platform-ec,fourier49/BZ_DEV_EC,md5555/ec,mtk09422/chromiumos-platform-ec,longsleep/ec