Skip to contentSkip to conversation

powerpc/83xx/mpc8349emitx: Get rid of of_node assignment

PATCH Applied Andy Shevchenko 5 participants 10 messages Mar 23, 2022 – May 15, 2022

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

PATCH 1/1 powerpc/83xx/mpc8349emitx: Get rid of of_node assignment

Let GPIO library to assign of_node from the parent device. This allows to move GPIO library and drivers to use fwnode APIs instead of being stuck with OF-only interfaces.

---
 arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)
arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c +5 -9
index a38372f9ac12..26b502773b3f 100644
@@ -8,15 +8,15 @@
  */
 
 #include <linux/kernel.h>
+#include <linux/mod_devicetable.h>
 #include <linux/module.h>
 #include <linux/device.h>
 #include <linux/mutex.h>
 #include <linux/i2c.h>
 #include <linux/gpio/driver.h>
-#include <linux/of.h>
-#include <linux/of_gpio.h>
 #include <linux/slab.h>
 #include <linux/kthread.h>
+#include <linux/property.h>
 #include <linux/reboot.h>
 #include <asm/prom.h>
 #include <asm/machdep.h>
@@ -116,21 +116,17 @@ static int mcu_gpio_dir_out(struct gpio_chip *gc, unsigned int gpio, int val)
 
 static int mcu_gpiochip_add(struct mcu *mcu)
 {
-	struct device_node *np;
+	struct device *dev = &mcu->client->dev;
 	struct gpio_chip *gc = &mcu->gc;
 
-	np = of_find_compatible_node(NULL, NULL, "fsl,mcu-mpc8349emitx");
-	if (!np)
-		return -ENODEV;
-
 	gc->owner = THIS_MODULE;
-	gc->label = kasprintf(GFP_KERNEL, "%pOF", np);
+	gc->label = kasprintf(GFP_KERNEL, "%pfw", dev_fwnode(dev));
 	gc->can_sleep = 1;
 	gc->ngpio = MCU_NUM_GPIO;
 	gc->base = -1;
 	gc->set = mcu_gpio_set;
 	gc->direction_output = mcu_gpio_dir_out;
-	gc->of_node = np;
+	gc->parent = dev;
 
 	return gpiochip_add_data(gc, mcu);
 }
Signature · 1 line
2.35.1
#2 lore raw
Quoted 11 lines · Linus Walleij
Quoted 5 lines · Andy Shevchenko

Let GPIO library to assign of_node from the parent device. This allows to move GPIO library and drivers to use fwnode APIs instead of being stuck with OF-only interfaces.

That's a nice patch.

Thanks!

Can we have this applied now?

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#3 lore raw
Quoted 8 lines · Andy Shevchenko
Quoted 7 lines · Linus Walleij
Quoted 4 lines · Andy Shevchenko

Let GPIO library to assign of_node from the parent device. This allows to move GPIO library and drivers to use fwnode APIs instead of being stuck with OF-only interfaces.

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

That's a nice patch.

Thanks!

Can we have this applied now?

I think Michael Ellerman could help with this?

Michael?

Yours,
Linus Walleij

#4 lore raw
Quoted 15 lines · Linus Walleij
Quoted 13 lines · Andy Shevchenko
Quoted 11 lines · Linus Walleij
Quoted 5 lines · Andy Shevchenko

Let GPIO library to assign of_node from the parent device. This allows to move GPIO library and drivers to use fwnode APIs instead of being stuck with OF-only interfaces.

That's a nice patch.

Quoted 7 lines
Quoted 3 lines

Thanks!

Can we have this applied now?

I think Michael Ellerman could help with this?

Michael?

Yep, I'll pick it up when I start putting things into next.

That's usually the week after rc2, but I had a break for Easter.

cheers

#5 lore raw
Quoted 20 lines · Michael Ellerman
Quoted 19 lines · Linus Walleij
Quoted 16 lines · Andy Shevchenko
Quoted 11 lines · Linus Walleij
Quoted 5 lines · Andy Shevchenko

Let GPIO library to assign of_node from the parent device. This allows to move GPIO library and drivers to use fwnode APIs instead of being stuck with OF-only interfaces.

That's a nice patch.

Thanks!

Can we have this applied now?

Quoted 7 lines
Quoted 3 lines

I think Michael Ellerman could help with this?

Michael?

Yep, I'll pick it up when I start putting things into next.

That's usually the week after rc2, but I had a break for Easter.

Any new on this? I haven't seen it yet in Linux Next.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#6 lore raw
Quoted 23 lines · Andy Shevchenko
Quoted 22 lines · Michael Ellerman
Quoted 21 lines · Linus Walleij
Quoted 8 lines · Andy Shevchenko
Quoted 7 lines · Linus Walleij
Quoted 4 lines · Andy Shevchenko

Let GPIO library to assign of_node from the parent device. This allows to move GPIO library and drivers to use fwnode APIs instead of being stuck with OF-only interfaces.

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

That's a nice patch.

Thanks!

Can we have this applied now?

I think Michael Ellerman could help with this?

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

Michael?

Yep, I'll pick it up when I start putting things into next.

That's usually the week after rc2, but I had a break for Easter.

Any new on this? I haven't seen it yet in Linux Next.

It's in today's next (next-20220505).

cheers

#7 lore raw
Quoted 2 lines · Michael Ellerman
Quoted 1 line · Andy Shevchenko

On Thu, Apr 21, 2022 at 08:42:30AM +1000, Michael Ellerman wrote:

...

Quoted 3 lines
Quoted 1 line

Any new on this? I haven't seen it yet in Linux Next.

It's in today's next (next-20220505).

Got it, thank you!

Signature · 2 lines
With Best Regards,
Andy Shevchenko
Acked-by on v1 1/1
#8 lore raw
In reply to Andy Shevchenko
Quoted 8 lines · Andy Shevchenko

Let GPIO library to assign of_node from the parent device. This allows to move GPIO library and drivers to use fwnode APIs instead of being stuck with OF-only interfaces.

---
 arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c | 14 +++++---------

 1 file changed, 5 insertions(+), 9 deletions(-)

-Scott