mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Alexander Shiyan <eagle.alexander923@gmail.com>,
	Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH] fixup! regulator: Add Fairchild FAN53555 driver
Date: Mon,  1 Jul 2024 20:12:39 +0200	[thread overview]
Message-ID: <20240701181239.1189755-1-a.fatoum@pengutronix.de> (raw)

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




             reply	other threads:[~2024-07-01 18:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-01 18:12 Ahmad Fatoum [this message]
2024-07-02  6:34 ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240701181239.1189755-1-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=eagle.alexander923@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox