mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] fixup! regulator: Add Fairchild FAN53555 driver
@ 2024-07-01 18:12 Ahmad Fatoum
  2024-07-02  6:34 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Ahmad Fatoum @ 2024-07-01 18:12 UTC (permalink / raw)
  To: barebox; +Cc: Alexander Shiyan, Ahmad Fatoum

GCC reports:

drivers/regulator/fan53555.c:362:17: warning: ‘mode_reg’ may be used
uninitialized [-Wmaybe-uninitialized]
362 |                 regmap_update_bits(di->rdev.regmap, mode_reg, mode_mask, 0);

Fix this by returning -EINVAL in that case, which is the error code used
earlier if the vendor is an unexpected value.

Cc: Alexander Shiyan <eagle.alexander923@gmail.com>
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 drivers/regulator/fan53555.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/regulator/fan53555.c b/drivers/regulator/fan53555.c
index d406d0b54a3e..f73511b36b20 100644
--- a/drivers/regulator/fan53555.c
+++ b/drivers/regulator/fan53555.c
@@ -315,6 +315,8 @@ static int fan53555_device_setup(struct fan53555_device_info *di)
 		case FAN53555_VSEL_ID_1:
 			mode_reg = FAN53555_VSEL0;
 			break;
+		default:
+			return -EINVAL;
 		}
 		break;
 	case FAN53526_VENDOR_TCS:
-- 
2.39.2




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] fixup! regulator: Add Fairchild FAN53555 driver
  2024-07-01 18:12 [PATCH] fixup! regulator: Add Fairchild FAN53555 driver Ahmad Fatoum
@ 2024-07-02  6:34 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2024-07-02  6:34 UTC (permalink / raw)
  To: barebox, Ahmad Fatoum; +Cc: Alexander Shiyan


On Mon, 01 Jul 2024 20:12:39 +0200, Ahmad Fatoum wrote:
> GCC reports:
> 
> drivers/regulator/fan53555.c:362:17: warning: ‘mode_reg’ may be used
> uninitialized [-Wmaybe-uninitialized]
> 362 |                 regmap_update_bits(di->rdev.regmap, mode_reg, mode_mask, 0);
> 
> Fix this by returning -EINVAL in that case, which is the error code used
> earlier if the vendor is an unexpected value.
> 
> [...]

Applied, thanks!

[1/1] fixup! regulator: Add Fairchild FAN53555 driver
      https://git.pengutronix.de/cgit/barebox/commit/?id=b6c1399875d6 (link may not be stable)

Best regards,
-- 
Sascha Hauer <s.hauer@pengutronix.de>




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-07-02  6:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-01 18:12 [PATCH] fixup! regulator: Add Fairchild FAN53555 driver Ahmad Fatoum
2024-07-02  6:34 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox