Skip to contentSkip to conversation

gpio: brcmstb: Use local variable to access OF node

PATCH Applied Andy Shevchenko 2 participants 2 messages Dec 23, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gpio: brcmstb: Use local variable to access OF node

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

---
 drivers/gpio/gpio-brcmstb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpio/gpio-brcmstb.c +1 -1
index 176c264bb959..74ef89248867 100644
@@ -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;
Signature · 1 line
2.34.1
#1 lore raw
Quoted 23 lines · Andy Shevchenko

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

---
 drivers/gpio/gpio-brcmstb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpio/gpio-brcmstb.c +1 -2
index 176c264bb959..74ef89248867 100644
@@ -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;
--
Quoted 2 lines

2.34.1

Applied, thanks!

Bart