From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Paul Cercueil <paul@crapouillou.net>
Cc: Pavel Machek <pavel@ucw.cz>,
Linux LED Subsystem <linux-leds@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] leds: max8997: Don't error if there is no pdata
Date: Mon, 8 Aug 2022 15:16:48 +0200 [thread overview]
Message-ID: <CAHp75VeafLqtdhasZ2mnk2sYv++a-HirHSePCcxteqPqBBy_uw@mail.gmail.com> (raw)
In-Reply-To: <20220807104027.10808-1-paul@crapouillou.net>
On Sun, Aug 7, 2022 at 12:40 PM Paul Cercueil <paul@crapouillou.net> wrote:
>
> The driver will works just fine if no platform data was supplied.
s/works/work/
...or...
s/will//
With the above fix,
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
> ---
> drivers/leds/leds-max8997.c | 7 +------
> 1 file changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/drivers/leds/leds-max8997.c b/drivers/leds/leds-max8997.c
> index c0bddb33888d..c8d7f55c9dec 100644
> --- a/drivers/leds/leds-max8997.c
> +++ b/drivers/leds/leds-max8997.c
> @@ -238,11 +238,6 @@ static int max8997_led_probe(struct platform_device *pdev)
> char name[20];
> int ret = 0;
>
> - if (pdata == NULL) {
> - dev_err(&pdev->dev, "no platform data\n");
> - return -ENODEV;
> - }
> -
> led = devm_kzalloc(&pdev->dev, sizeof(*led), GFP_KERNEL);
> if (led == NULL)
> return -ENOMEM;
> @@ -258,7 +253,7 @@ static int max8997_led_probe(struct platform_device *pdev)
> led->iodev = iodev;
>
> /* initialize mode and brightness according to platform_data */
> - if (pdata->led_pdata) {
> + if (pdata && pdata->led_pdata) {
> u8 mode = 0, brightness = 0;
>
> mode = pdata->led_pdata->mode[led->id];
--
With Best Regards,
Andy Shevchenko
prev parent reply other threads:[~2022-08-08 13:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-07 10:40 [PATCH] leds: max8997: Don't error if there is no pdata Paul Cercueil
2022-08-08 13:16 ` Andy Shevchenko [this message]
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=CAHp75VeafLqtdhasZ2mnk2sYv++a-HirHSePCcxteqPqBBy_uw@mail.gmail.com \
--to=andy.shevchenko@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=paul@crapouillou.net \
--cc=pavel@ucw.cz \
/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;
as well as URLs for NNTP newsgroup(s).