linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 1/1] gpio: brcmstb: Use local variable to access OF node
@ 2021-12-23 13:15 Andy Shevchenko
  2021-12-23 16:09 ` Bartosz Golaszewski
  0 siblings, 1 reply; 2+ messages in thread
From: Andy Shevchenko @ 2021-12-23 13:15 UTC (permalink / raw)
  To: Andy Shevchenko, Sergio Paracuellos, bcm-kernel-feedback-list,
	linux-gpio, linux-arm-kernel, linux-kernel
  Cc: Gregory Fong, Linus Walleij, Bartosz Golaszewski, Florian Fainelli

We already have a local variable that contains a copy of OF node pointer.
Use it instead of dereferencing it again from struct device.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/gpio/gpio-brcmstb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-brcmstb.c b/drivers/gpio/gpio-brcmstb.c
index 176c264bb959..74ef89248867 100644
--- a/drivers/gpio/gpio-brcmstb.c
+++ b/drivers/gpio/gpio-brcmstb.c
@@ -704,7 +704,7 @@ static int brcmstb_gpio_probe(struct platform_device *pdev)
 		}
 
 		gc->owner = THIS_MODULE;
-		gc->label = devm_kasprintf(dev, GFP_KERNEL, "%pOF", dev->of_node);
+		gc->label = devm_kasprintf(dev, GFP_KERNEL, "%pOF", np);
 		if (!gc->label) {
 			err = -ENOMEM;
 			goto fail;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v1 1/1] gpio: brcmstb: Use local variable to access OF node
  2021-12-23 13:15 [PATCH v1 1/1] gpio: brcmstb: Use local variable to access OF node Andy Shevchenko
@ 2021-12-23 16:09 ` Bartosz Golaszewski
  0 siblings, 0 replies; 2+ messages in thread
From: Bartosz Golaszewski @ 2021-12-23 16:09 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Sergio Paracuellos, bcm-kernel-feedback-list,
	open list:GPIO SUBSYSTEM, Linux ARM, Linux Kernel Mailing List,
	Gregory Fong, Linus Walleij, Florian Fainelli

On Thu, Dec 23, 2021 at 2:15 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> We already have a local variable that contains a copy of OF node pointer.
> Use it instead of dereferencing it again from struct device.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/gpio/gpio-brcmstb.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpio/gpio-brcmstb.c b/drivers/gpio/gpio-brcmstb.c
> index 176c264bb959..74ef89248867 100644
> --- a/drivers/gpio/gpio-brcmstb.c
> +++ b/drivers/gpio/gpio-brcmstb.c
> @@ -704,7 +704,7 @@ static int brcmstb_gpio_probe(struct platform_device *pdev)
>                 }
>
>                 gc->owner = THIS_MODULE;
> -               gc->label = devm_kasprintf(dev, GFP_KERNEL, "%pOF", dev->of_node);
> +               gc->label = devm_kasprintf(dev, GFP_KERNEL, "%pOF", np);
>                 if (!gc->label) {
>                         err = -ENOMEM;
>                         goto fail;
> --
> 2.34.1
>

Applied, thanks!

Bart

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-12-23 16:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-23 13:15 [PATCH v1 1/1] gpio: brcmstb: Use local variable to access OF node Andy Shevchenko
2021-12-23 16:09 ` Bartosz Golaszewski

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).