linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 1/1] powerpc/83xx/mpc8349emitx: Get rid of of_node assignment
@ 2022-03-23 17:43 Andy Shevchenko
  2022-03-28 13:16 ` Linus Walleij
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Andy Shevchenko @ 2022-03-23 17:43 UTC (permalink / raw)
  To: Andy Shevchenko, linuxppc-dev, linux-kernel
  Cc: Scott Wood, Michael Ellerman, Benjamin Herrenschmidt,
	Paul Mackerras, Bartosz Golaszewski, Linus Walleij

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.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c b/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c
index a38372f9ac12..26b502773b3f 100644
--- a/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c
+++ b/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c
@@ -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);
 }
-- 
2.35.1


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

* Re: [PATCH v1 1/1] powerpc/83xx/mpc8349emitx: Get rid of of_node assignment
  2022-03-23 17:43 [PATCH v1 1/1] powerpc/83xx/mpc8349emitx: Get rid of of_node assignment Andy Shevchenko
@ 2022-03-28 13:16 ` Linus Walleij
  2022-04-06 13:01   ` Andy Shevchenko
  2022-04-06 20:13 ` Scott Wood
  2022-05-15 10:12 ` Michael Ellerman
  2 siblings, 1 reply; 10+ messages in thread
From: Linus Walleij @ 2022-03-28 13:16 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: linuxppc-dev, linux-kernel, Scott Wood, Michael Ellerman,
	Benjamin Herrenschmidt, Paul Mackerras, Bartosz Golaszewski

On Wed, Mar 23, 2022 at 6:43 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:

> 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.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

That's a nice patch.
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

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

* Re: [PATCH v1 1/1] powerpc/83xx/mpc8349emitx: Get rid of of_node assignment
  2022-03-28 13:16 ` Linus Walleij
@ 2022-04-06 13:01   ` Andy Shevchenko
  2022-04-19 21:38     ` Linus Walleij
  0 siblings, 1 reply; 10+ messages in thread
From: Andy Shevchenko @ 2022-04-06 13:01 UTC (permalink / raw)
  To: Linus Walleij
  Cc: linuxppc-dev, linux-kernel, Scott Wood, Michael Ellerman,
	Benjamin Herrenschmidt, Paul Mackerras, Bartosz Golaszewski

On Mon, Mar 28, 2022 at 03:16:08PM +0200, Linus Walleij wrote:
> On Wed, Mar 23, 2022 at 6:43 PM Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> 
> > 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.
> >
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> 
> That's a nice patch.
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Thanks!

Can we have this applied now?

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH v1 1/1] powerpc/83xx/mpc8349emitx: Get rid of of_node assignment
  2022-03-23 17:43 [PATCH v1 1/1] powerpc/83xx/mpc8349emitx: Get rid of of_node assignment Andy Shevchenko
  2022-03-28 13:16 ` Linus Walleij
@ 2022-04-06 20:13 ` Scott Wood
  2022-05-15 10:12 ` Michael Ellerman
  2 siblings, 0 replies; 10+ messages in thread
From: Scott Wood @ 2022-04-06 20:13 UTC (permalink / raw)
  To: Andy Shevchenko, linuxppc-dev, linux-kernel
  Cc: Michael Ellerman, Benjamin Herrenschmidt, Paul Mackerras,
	Bartosz Golaszewski, Linus Walleij

On Wed, 2022-03-23 at 19:43 +0200, Andy Shevchenko wrote:
> 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.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c | 14 +++++---------
>  1 file changed, 5 insertions(+), 9 deletions(-)

Acked-by: Scott Wood <oss@buserror.net>

-Scott



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

* Re: [PATCH v1 1/1] powerpc/83xx/mpc8349emitx: Get rid of of_node assignment
  2022-04-06 13:01   ` Andy Shevchenko
@ 2022-04-19 21:38     ` Linus Walleij
  2022-04-20 22:42       ` Michael Ellerman
  0 siblings, 1 reply; 10+ messages in thread
From: Linus Walleij @ 2022-04-19 21:38 UTC (permalink / raw)
  To: Andy Shevchenko, Michael Ellerman
  Cc: linuxppc-dev, linux-kernel, Scott Wood, Benjamin Herrenschmidt,
	Paul Mackerras, Bartosz Golaszewski

On Wed, Apr 6, 2022 at 3:02 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
> On Mon, Mar 28, 2022 at 03:16:08PM +0200, Linus Walleij wrote:
> > On Wed, Mar 23, 2022 at 6:43 PM Andy Shevchenko
> > <andriy.shevchenko@linux.intel.com> wrote:
> >
> > > 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.
> > >
> > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> >
> > That's a nice patch.
> > Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
>
> Thanks!
>
> Can we have this applied now?

I think Michael Ellerman could help with this?

Michael?

Yours,
Linus Walleij

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

* Re: [PATCH v1 1/1] powerpc/83xx/mpc8349emitx: Get rid of of_node assignment
  2022-04-19 21:38     ` Linus Walleij
@ 2022-04-20 22:42       ` Michael Ellerman
  2022-05-04 13:45         ` Andy Shevchenko
  0 siblings, 1 reply; 10+ messages in thread
From: Michael Ellerman @ 2022-04-20 22:42 UTC (permalink / raw)
  To: Linus Walleij, Andy Shevchenko
  Cc: linuxppc-dev, linux-kernel, Scott Wood, Benjamin Herrenschmidt,
	Paul Mackerras, Bartosz Golaszewski

Linus Walleij <linus.walleij@linaro.org> writes:
> On Wed, Apr 6, 2022 at 3:02 PM Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
>> On Mon, Mar 28, 2022 at 03:16:08PM +0200, Linus Walleij wrote:
>> > On Wed, Mar 23, 2022 at 6:43 PM Andy Shevchenko
>> > <andriy.shevchenko@linux.intel.com> wrote:
>> >
>> > > 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.
>> > >
>> > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
>> >
>> > That's a nice patch.
>> > Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
>>
>> 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

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

* Re: [PATCH v1 1/1] powerpc/83xx/mpc8349emitx: Get rid of of_node assignment
  2022-04-20 22:42       ` Michael Ellerman
@ 2022-05-04 13:45         ` Andy Shevchenko
  2022-05-05 11:04           ` Michael Ellerman
  0 siblings, 1 reply; 10+ messages in thread
From: Andy Shevchenko @ 2022-05-04 13:45 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: Linus Walleij, linuxppc-dev, linux-kernel, Scott Wood,
	Benjamin Herrenschmidt, Paul Mackerras, Bartosz Golaszewski

On Thu, Apr 21, 2022 at 08:42:30AM +1000, Michael Ellerman wrote:
> Linus Walleij <linus.walleij@linaro.org> writes:
> > On Wed, Apr 6, 2022 at 3:02 PM Andy Shevchenko
> > <andriy.shevchenko@linux.intel.com> wrote:
> >> On Mon, Mar 28, 2022 at 03:16:08PM +0200, Linus Walleij wrote:
> >> > On Wed, Mar 23, 2022 at 6:43 PM Andy Shevchenko
> >> > <andriy.shevchenko@linux.intel.com> wrote:
> >> >
> >> > > 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.
> >> > >
> >> > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> >> >
> >> > That's a nice patch.
> >> > Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
> >>
> >> 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.

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

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH v1 1/1] powerpc/83xx/mpc8349emitx: Get rid of of_node assignment
  2022-05-04 13:45         ` Andy Shevchenko
@ 2022-05-05 11:04           ` Michael Ellerman
  2022-05-05 11:23             ` Andy Shevchenko
  0 siblings, 1 reply; 10+ messages in thread
From: Michael Ellerman @ 2022-05-05 11:04 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Linus Walleij, linuxppc-dev, linux-kernel, Scott Wood,
	Benjamin Herrenschmidt, Paul Mackerras, Bartosz Golaszewski

Andy Shevchenko <andriy.shevchenko@linux.intel.com> writes:
> On Thu, Apr 21, 2022 at 08:42:30AM +1000, Michael Ellerman wrote:
>> Linus Walleij <linus.walleij@linaro.org> writes:
>> > On Wed, Apr 6, 2022 at 3:02 PM Andy Shevchenko
>> > <andriy.shevchenko@linux.intel.com> wrote:
>> >> On Mon, Mar 28, 2022 at 03:16:08PM +0200, Linus Walleij wrote:
>> >> > On Wed, Mar 23, 2022 at 6:43 PM Andy Shevchenko
>> >> > <andriy.shevchenko@linux.intel.com> wrote:
>> >> >
>> >> > > 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.
>> >> > >
>> >> > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
>> >> >
>> >> > That's a nice patch.
>> >> > Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
>> >>
>> >> 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.
>
> Any new on this? I haven't seen it yet in Linux Next.

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

cheers

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

* Re: [PATCH v1 1/1] powerpc/83xx/mpc8349emitx: Get rid of of_node assignment
  2022-05-05 11:04           ` Michael Ellerman
@ 2022-05-05 11:23             ` Andy Shevchenko
  0 siblings, 0 replies; 10+ messages in thread
From: Andy Shevchenko @ 2022-05-05 11:23 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: Linus Walleij, linuxppc-dev, linux-kernel, Scott Wood,
	Benjamin Herrenschmidt, Paul Mackerras, Bartosz Golaszewski

On Thu, May 05, 2022 at 09:04:46PM +1000, Michael Ellerman wrote:
> Andy Shevchenko <andriy.shevchenko@linux.intel.com> writes:
> > On Thu, Apr 21, 2022 at 08:42:30AM +1000, Michael Ellerman wrote:

...

> > 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!

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH v1 1/1] powerpc/83xx/mpc8349emitx: Get rid of of_node assignment
  2022-03-23 17:43 [PATCH v1 1/1] powerpc/83xx/mpc8349emitx: Get rid of of_node assignment Andy Shevchenko
  2022-03-28 13:16 ` Linus Walleij
  2022-04-06 20:13 ` Scott Wood
@ 2022-05-15 10:12 ` Michael Ellerman
  2 siblings, 0 replies; 10+ messages in thread
From: Michael Ellerman @ 2022-05-15 10:12 UTC (permalink / raw)
  To: linuxppc-dev, linux-kernel, Andy Shevchenko
  Cc: Scott Wood, Michael Ellerman, Bartosz Golaszewski, Linus Walleij,
	Benjamin Herrenschmidt, Paul Mackerras

On Wed, 23 Mar 2022 19:43:42 +0200, Andy Shevchenko wrote:
> 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.
> 
> 

Applied to powerpc/next.

[1/1] powerpc/83xx/mpc8349emitx: Get rid of of_node assignment
      https://git.kernel.org/powerpc/c/610cc9f45881f1a3758f323d6d7d67e572958c3b

cheers

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

end of thread, other threads:[~2022-05-15 10:14 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-23 17:43 [PATCH v1 1/1] powerpc/83xx/mpc8349emitx: Get rid of of_node assignment Andy Shevchenko
2022-03-28 13:16 ` Linus Walleij
2022-04-06 13:01   ` Andy Shevchenko
2022-04-19 21:38     ` Linus Walleij
2022-04-20 22:42       ` Michael Ellerman
2022-05-04 13:45         ` Andy Shevchenko
2022-05-05 11:04           ` Michael Ellerman
2022-05-05 11:23             ` Andy Shevchenko
2022-04-06 20:13 ` Scott Wood
2022-05-15 10:12 ` Michael Ellerman

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