2008-07-09 10:50:44

by Ben Dooks

[permalink] [raw]
Subject: [patch 1/4] MFD: Use to_platform_device instead of container_of.

Convert mfd_remove_devices_fn() to use to_platform_device()
instead of doing container_of().

Signed-off-by: Ben Dooks <[email protected]>

Index: linux-2.6.26-rc9-next20080709/drivers/mfd/mfd-core.c
===================================================================
--- linux-2.6.26-rc9-next20080709.orig/drivers/mfd/mfd-core.c 2008-07-09 10:13:53.000000000 +0100
+++ linux-2.6.26-rc9-next20080709/drivers/mfd/mfd-core.c 2008-07-09 10:14:26.000000000 +0100
@@ -99,8 +99,7 @@ EXPORT_SYMBOL(mfd_add_devices);

static int mfd_remove_devices_fn(struct device *dev, void *unused)
{
- platform_device_unregister(
- container_of(dev, struct platform_device, dev));
+ platform_device_unregister(to_platform_device(dev));
return 0;
}


--


2008-07-09 11:10:20

by Dmitry Baryshkov

[permalink] [raw]
Subject: Re: [patch 1/4] MFD: Use to_platform_device instead of container_of.

2008/7/9 Ben Dooks <[email protected]>:
> Convert mfd_remove_devices_fn() to use to_platform_device()
> instead of doing container_of().
>
> Signed-off-by: Ben Dooks <[email protected]>

Acked-by: Dmitry Baryshkov <[email protected]>

>
> Index: linux-2.6.26-rc9-next20080709/drivers/mfd/mfd-core.c
> ===================================================================
> --- linux-2.6.26-rc9-next20080709.orig/drivers/mfd/mfd-core.c 2008-07-09 10:13:53.000000000 +0100
> +++ linux-2.6.26-rc9-next20080709/drivers/mfd/mfd-core.c 2008-07-09 10:14:26.000000000 +0100
> @@ -99,8 +99,7 @@ EXPORT_SYMBOL(mfd_add_devices);
>
> static int mfd_remove_devices_fn(struct device *dev, void *unused)
> {
> - platform_device_unregister(
> - container_of(dev, struct platform_device, dev));
> + platform_device_unregister(to_platform_device(dev));
> return 0;
> }
>
>
> --
>



--
With best wishes
Dmitry

2008-07-10 14:45:58

by Samuel Ortiz

[permalink] [raw]
Subject: Re: [patch 1/4] MFD: Use to_platform_device instead of container_of.

On Wed, Jul 09, 2008 at 03:10:01PM +0400, Dmitry wrote:
> 2008/7/9 Ben Dooks <[email protected]>:
> > Convert mfd_remove_devices_fn() to use to_platform_device()
> > instead of doing container_of().
> >
> > Signed-off-by: Ben Dooks <[email protected]>
>
> Acked-by: Dmitry Baryshkov <[email protected]>
I'll apply this one after the merge window.

Cheers,
Samuel.


> >
> > Index: linux-2.6.26-rc9-next20080709/drivers/mfd/mfd-core.c
> > ===================================================================
> > --- linux-2.6.26-rc9-next20080709.orig/drivers/mfd/mfd-core.c 2008-07-09 10:13:53.000000000 +0100
> > +++ linux-2.6.26-rc9-next20080709/drivers/mfd/mfd-core.c 2008-07-09 10:14:26.000000000 +0100
> > @@ -99,8 +99,7 @@ EXPORT_SYMBOL(mfd_add_devices);
> >
> > static int mfd_remove_devices_fn(struct device *dev, void *unused)
> > {
> > - platform_device_unregister(
> > - container_of(dev, struct platform_device, dev));
> > + platform_device_unregister(to_platform_device(dev));
> > return 0;
> > }
> >
> >
> > --
> >
>
>
>
> --
> With best wishes
> Dmitry

2008-07-29 00:06:58

by Samuel Ortiz

[permalink] [raw]
Subject: Re: [patch 1/4] MFD: Use to_platform_device instead of container_of.

On Wed, Jul 09, 2008 at 11:49:17AM +0100, Ben Dooks wrote:
> Convert mfd_remove_devices_fn() to use to_platform_device()
> instead of doing container_of().
>
> Signed-off-by: Ben Dooks <[email protected]>
Applied to the MFD tree, thanks.


> Index: linux-2.6.26-rc9-next20080709/drivers/mfd/mfd-core.c
> ===================================================================
> --- linux-2.6.26-rc9-next20080709.orig/drivers/mfd/mfd-core.c 2008-07-09 10:13:53.000000000 +0100
> +++ linux-2.6.26-rc9-next20080709/drivers/mfd/mfd-core.c 2008-07-09 10:14:26.000000000 +0100
> @@ -99,8 +99,7 @@ EXPORT_SYMBOL(mfd_add_devices);
>
> static int mfd_remove_devices_fn(struct device *dev, void *unused)
> {
> - platform_device_unregister(
> - container_of(dev, struct platform_device, dev));
> + platform_device_unregister(to_platform_device(dev));
> return 0;
> }
>
>
> --