From: Pavel Machek <pavel@ucw.cz>
To: Sasha Levin <sashal@kernel.org>
Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org,
Chuhong Yuan <hslester96@gmail.com>,
linux-leds@vger.kernel.org
Subject: Re: [PATCH AUTOSEL 5.4 033/134] leds: an30259a: add a check for devm_regmap_init_i2c
Date: Sat, 14 Dec 2019 09:42:58 +0100 [thread overview]
Message-ID: <20191214084258.GC16834@duo.ucw.cz> (raw)
In-Reply-To: <20191211151150.19073-33-sashal@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 1370 bytes --]
On Wed 2019-12-11 10:10:09, Sasha Levin wrote:
> From: Chuhong Yuan <hslester96@gmail.com>
>
> [ Upstream commit fc7b5028f2627133c7c18734715a08829eab4d1f ]
>
> an30259a_probe misses a check for devm_regmap_init_i2c and may cause
> problems.
> Add a check and print errors like other leds drivers.
Please drop.
Pavel
> Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
> Signed-off-by: Pavel Machek <pavel@ucw.cz>
> Signed-off-by: Sasha Levin <sashal@kernel.org>
> ---
> drivers/leds/leds-an30259a.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/drivers/leds/leds-an30259a.c b/drivers/leds/leds-an30259a.c
> index 250dc9d6f6350..82350a28a5644 100644
> --- a/drivers/leds/leds-an30259a.c
> +++ b/drivers/leds/leds-an30259a.c
> @@ -305,6 +305,13 @@ static int an30259a_probe(struct i2c_client *client)
>
> chip->regmap = devm_regmap_init_i2c(client, &an30259a_regmap_config);
>
> + if (IS_ERR(chip->regmap)) {
> + err = PTR_ERR(chip->regmap);
> + dev_err(&client->dev, "Failed to allocate register map: %d\n",
> + err);
> + goto exit;
> + }
> +
> for (i = 0; i < chip->num_leds; i++) {
> struct led_init_data init_data = {};
>
> --
> 2.20.1
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
next prev parent reply other threads:[~2019-12-14 8:43 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20191211151150.19073-1-sashal@kernel.org>
2019-12-11 15:10 ` [PATCH AUTOSEL 5.4 032/134] leds: lm3692x: Handle failure to probe the regulator Sasha Levin
2019-12-14 8:42 ` Pavel Machek
2019-12-11 15:10 ` [PATCH AUTOSEL 5.4 033/134] leds: an30259a: add a check for devm_regmap_init_i2c Sasha Levin
2019-12-14 8:42 ` Pavel Machek [this message]
2019-12-11 15:10 ` [PATCH AUTOSEL 5.4 034/134] leds: trigger: netdev: fix handling on interface rename Sasha Levin
2019-12-14 8:43 ` Pavel Machek
2019-12-14 18:11 ` Sasha Levin
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=20191214084258.GC16834@duo.ucw.cz \
--to=pavel@ucw.cz \
--cc=hslester96@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=sashal@kernel.org \
--cc=stable@vger.kernel.org \
/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