From: Daniel Thompson <daniel.thompson@linaro.org>
To: Bartosz Golaszewski <brgl@bgdev.pl>, Sekhar Nori <nsekhar@ti.com>,
Kevin Hilman <khilman@kernel.org>,
Lee Jones <lee.jones@linaro.org>,
Jingoo Han <jingoohan1@gmail.com>,
Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
David Lechner <david@lechnology.com>,
Linus Walleij <linus.walleij@linaro.org>
Cc: linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
linux-fbdev@vger.kernel.org,
Bartosz Golaszewski <bgolaszewski@baylibre.com>
Subject: Re: [PATCH 02/12] backlight: gpio: use a helper variable for &pdev->dev
Date: Tue, 2 Jul 2019 10:05:41 +0100 [thread overview]
Message-ID: <ada53c47-c768-8390-928a-caf7cb72bcac@linaro.org> (raw)
In-Reply-To: <20190625163434.13620-3-brgl@bgdev.pl>
On 25/06/2019 17:34, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>
> Instead of dereferencing pdev each time, use a helper variable for
> the associated device pointer.
>
> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
No objections but I think this will need to be respun against
backlight-next (or v5.3).
> ---
> drivers/video/backlight/gpio_backlight.c | 14 +++++++-------
> 1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/video/backlight/gpio_backlight.c b/drivers/video/backlight/gpio_backlight.c
> index 654c19d3a81d..8adbc8d75097 100644
> --- a/drivers/video/backlight/gpio_backlight.c
> +++ b/drivers/video/backlight/gpio_backlight.c
> @@ -83,15 +83,16 @@ static int gpio_backlight_probe(struct platform_device *pdev)
> struct gpio_backlight_platform_data *pdata =
> dev_get_platdata(&pdev->dev);
Why leave this one out?
Daniel.
> struct backlight_properties props;
> + struct device *dev = &pdev->dev;
> struct backlight_device *bl;
> struct gpio_backlight *gbl;
> int ret;
>
> - gbl = devm_kzalloc(&pdev->dev, sizeof(*gbl), GFP_KERNEL);
> + gbl = devm_kzalloc(dev, sizeof(*gbl), GFP_KERNEL);
> if (gbl == NULL)
> return -ENOMEM;
>
> - gbl->dev = &pdev->dev;
> + gbl->dev = dev;
>
> if (pdata) {
> /*
> @@ -108,7 +109,7 @@ static int gpio_backlight_probe(struct platform_device *pdev)
> ret = devm_gpio_request_one(gbl->dev, pdata->gpio, flags,
> pdata ? pdata->name : "backlight");
> if (ret < 0) {
> - dev_err(&pdev->dev, "unable to request GPIO\n");
> + dev_err(dev, "unable to request GPIO\n");
> return ret;
> }
> gbl->gpiod = gpio_to_desc(pdata->gpio);
> @@ -123,11 +124,10 @@ static int gpio_backlight_probe(struct platform_device *pdev)
> memset(&props, 0, sizeof(props));
> props.type = BACKLIGHT_RAW;
> props.max_brightness = 1;
> - bl = devm_backlight_device_register(&pdev->dev, dev_name(&pdev->dev),
> - &pdev->dev, gbl, &gpio_backlight_ops,
> - &props);
> + bl = devm_backlight_device_register(dev, dev_name(dev), dev, gbl,
> + &gpio_backlight_ops, &props);
> if (IS_ERR(bl)) {
> - dev_err(&pdev->dev, "failed to register backlight\n");
> + dev_err(dev, "failed to register backlight\n");
> return PTR_ERR(bl);
> }
>
>
next prev parent reply other threads:[~2019-07-02 9:05 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-25 16:34 [PATCH 00/12] ARM: davinci: da850-evm: remove more legacy GPIO calls Bartosz Golaszewski
2019-06-25 16:34 ` [PATCH 01/12] backlight: gpio: allow to probe non-pdata devices from board files Bartosz Golaszewski
2019-06-28 12:58 ` Bartlomiej Zolnierkiewicz
2019-07-02 9:02 ` Daniel Thompson
2019-06-25 16:34 ` [PATCH 02/12] backlight: gpio: use a helper variable for &pdev->dev Bartosz Golaszewski
2019-06-28 12:59 ` Bartlomiej Zolnierkiewicz
2019-07-02 9:05 ` Daniel Thompson [this message]
2019-06-25 16:34 ` [PATCH 03/12] backlight: gpio: pull the non-pdata device probing code into probe() Bartosz Golaszewski
2019-06-27 11:14 ` Linus Walleij
2019-06-28 12:59 ` Bartlomiej Zolnierkiewicz
2019-07-02 9:11 ` Daniel Thompson
2019-06-25 16:34 ` [PATCH 04/12] ARM: davinci: refresh davinci_all_defconfig Bartosz Golaszewski
2019-06-25 16:34 ` [PATCH 05/12] ARM: davinci_all_defconfig: enable GPIO backlight Bartosz Golaszewski
2019-06-25 16:34 ` [PATCH 06/12] ARM: davinci: da850-evm: model the backlight GPIO as an actual device Bartosz Golaszewski
2019-06-27 11:16 ` Linus Walleij
2019-06-25 16:34 ` [PATCH 07/12] fbdev: da8xx: add support for a regulator Bartosz Golaszewski
2019-06-28 13:03 ` Bartlomiej Zolnierkiewicz
2019-06-25 16:34 ` [PATCH 08/12] ARM: davinci: da850-evm: switch to using a fixed regulator for lcdc Bartosz Golaszewski
2019-06-27 11:18 ` Linus Walleij
2019-06-25 16:34 ` [PATCH 09/12] fbdev: da8xx: remove panel_power_ctrl() callback from platform data Bartosz Golaszewski
2019-06-28 13:04 ` Bartlomiej Zolnierkiewicz
2019-06-25 16:34 ` [PATCH 10/12] fbdev: da8xx-fb: use devm_platform_ioremap_resource() Bartosz Golaszewski
2019-06-28 13:04 ` Bartlomiej Zolnierkiewicz
2019-06-25 16:34 ` [PATCH 11/12] fbdev: da8xx-fb: drop a redundant if Bartosz Golaszewski
2019-06-28 13:05 ` Bartlomiej Zolnierkiewicz
2019-06-25 16:34 ` [PATCH 12/12] fbdev: da8xx: use resource management for dma Bartosz Golaszewski
2019-06-28 13:06 ` Bartlomiej Zolnierkiewicz
2019-07-01 14:40 ` [PATCH 00/12] ARM: davinci: da850-evm: remove more legacy GPIO calls Sekhar Nori
2019-07-02 6:36 ` Lee Jones
2019-07-02 10:06 ` Daniel Thompson
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=ada53c47-c768-8390-928a-caf7cb72bcac@linaro.org \
--to=daniel.thompson@linaro.org \
--cc=b.zolnierkie@samsung.com \
--cc=bgolaszewski@baylibre.com \
--cc=brgl@bgdev.pl \
--cc=david@lechnology.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=jingoohan1@gmail.com \
--cc=khilman@kernel.org \
--cc=lee.jones@linaro.org \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nsekhar@ti.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;
as well as URLs for NNTP newsgroup(s).