From: Lee Jones <lee.jones@linaro.org>
To: linux-fbdev@vger.kernel.org
Subject: Re: [PATCH] video: backlight: lcd: fix race condition during register
Date: Fri, 05 Aug 2016 09:09:45 +0000 [thread overview]
Message-ID: <20160805090945.GV5243@dell> (raw)
On Wed, 06 Jul 2016, Uwe Kleine-König wrote:
> From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
>
> Once device_register is called for a device its attributes might be
> accessed. As the callbacks of a lcd device's attributes make use of the
> lcd_ops, the respective member must be setup before calling
> device_register.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
> drivers/video/backlight/lcd.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Applied, thanks.
> diff --git a/drivers/video/backlight/lcd.c b/drivers/video/backlight/lcd.c
> index 7de847df224f..4b40c6a4d441 100644
> --- a/drivers/video/backlight/lcd.c
> +++ b/drivers/video/backlight/lcd.c
> @@ -226,6 +226,8 @@ struct lcd_device *lcd_device_register(const char *name, struct device *parent,
> dev_set_name(&new_ld->dev, "%s", name);
> dev_set_drvdata(&new_ld->dev, devdata);
>
> + new_ld->ops = ops;
> +
> rc = device_register(&new_ld->dev);
> if (rc) {
> put_device(&new_ld->dev);
> @@ -238,8 +240,6 @@ struct lcd_device *lcd_device_register(const char *name, struct device *parent,
> return ERR_PTR(rc);
> }
>
> - new_ld->ops = ops;
> -
> return new_ld;
> }
> EXPORT_SYMBOL(lcd_device_register);
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
next reply other threads:[~2016-08-05 9:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-05 9:09 Lee Jones [this message]
-- strict thread matches above, loose matches on Subject: below --
2016-07-06 17:33 [PATCH] video: backlight: lcd: fix race condition during register Uwe Kleine-König
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=20160805090945.GV5243@dell \
--to=lee.jones@linaro.org \
--cc=linux-fbdev@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.