Re: [PATCH 2/4] Create and hook up of_platform_device_shutdown
On Fri, 2008-01-25 at 16:59 +1100, Michael Ellerman wrote: Although of_platform_device's can have a shutdown routine, at the moment the bus code doesn't actually call it. So add the required glue to hook the shutdown routine. Signed-off-by: Michael Ellerman [EMAIL PROTECTED] Acked-by: Benjamin Herrenschmidt [EMAIL PROTECTED] --- drivers/of/platform.c | 10 ++ 1 files changed, 10 insertions(+), 0 deletions(-) CC various folks who've written/touched of_platform_drivers which already have shutdown routines. These routines have never been called so they're about to get their first testing. diff --git a/drivers/of/platform.c b/drivers/of/platform.c index b47bb2d..ca09a63 100644 --- a/drivers/of/platform.c +++ b/drivers/of/platform.c @@ -85,6 +85,15 @@ static int of_platform_device_resume(struct device * dev) return error; } +static void of_platform_device_shutdown(struct device *dev) +{ + struct of_device *of_dev = to_of_device(dev); + struct of_platform_driver *drv = to_of_platform_driver(dev-driver); + + if (dev-driver drv-shutdown) + drv-shutdown(of_dev); +} + int of_bus_type_init(struct bus_type *bus, const char *name) { bus-name = name; @@ -93,6 +102,7 @@ int of_bus_type_init(struct bus_type *bus, const char *name) bus-remove = of_platform_device_remove; bus-suspend = of_platform_device_suspend; bus-resume = of_platform_device_resume; + bus-shutdown = of_platform_device_shutdown; return bus_register(bus); } ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH 2/4] Create and hook up of_platform_device_shutdown
Although of_platform_device's can have a shutdown routine, at the moment the bus code doesn't actually call it. So add the required glue to hook the shutdown routine. Signed-off-by: Michael Ellerman [EMAIL PROTECTED] --- drivers/of/platform.c | 10 ++ 1 files changed, 10 insertions(+), 0 deletions(-) CC various folks who've written/touched of_platform_drivers which already have shutdown routines. These routines have never been called so they're about to get their first testing. diff --git a/drivers/of/platform.c b/drivers/of/platform.c index b47bb2d..ca09a63 100644 --- a/drivers/of/platform.c +++ b/drivers/of/platform.c @@ -85,6 +85,15 @@ static int of_platform_device_resume(struct device * dev) return error; } +static void of_platform_device_shutdown(struct device *dev) +{ + struct of_device *of_dev = to_of_device(dev); + struct of_platform_driver *drv = to_of_platform_driver(dev-driver); + + if (dev-driver drv-shutdown) + drv-shutdown(of_dev); +} + int of_bus_type_init(struct bus_type *bus, const char *name) { bus-name = name; @@ -93,6 +102,7 @@ int of_bus_type_init(struct bus_type *bus, const char *name) bus-remove = of_platform_device_remove; bus-suspend = of_platform_device_suspend; bus-resume = of_platform_device_resume; + bus-shutdown = of_platform_device_shutdown; return bus_register(bus); } -- 1.5.2.rc1.1884.g59b20 ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH 2/4] Create and hook up of_platform_device_shutdown
Although of_platform_device's can have a shutdown routine, at the moment the bus code doesn't actually call it. So add the required glue to hook the shutdown routine. Signed-off-by: Michael Ellerman [EMAIL PROTECTED] --- drivers/of/platform.c | 10 ++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/drivers/of/platform.c b/drivers/of/platform.c index b47bb2d..9152479 100644 --- a/drivers/of/platform.c +++ b/drivers/of/platform.c @@ -85,6 +85,15 @@ static int of_platform_device_resume(struct device * dev) return error; } +static void of_platform_device_shutdown(struct device * dev) +{ + struct of_device *of_dev = to_of_device(dev); + struct of_platform_driver *drv = to_of_platform_driver(dev-driver); + + if (dev-driver drv-shutdown) + drv-shutdown(of_dev); +} + int of_bus_type_init(struct bus_type *bus, const char *name) { bus-name = name; @@ -93,6 +102,7 @@ int of_bus_type_init(struct bus_type *bus, const char *name) bus-remove = of_platform_device_remove; bus-suspend = of_platform_device_suspend; bus-resume = of_platform_device_resume; + bus-shutdown = of_platform_device_shutdown; return bus_register(bus); } -- 1.5.2.rc1.1884.g59b20 ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH 2/4] Create and hook up of_platform_device_shutdown
Hi Michael, Just a couple of things. On Tue, 22 Jan 2008 22:04:40 +1100 (EST) Michael Ellerman [EMAIL PROTECTED] wrote: +static void of_platform_device_shutdown(struct device * dev) ^ No space, please. Also, I wonder if we should check that the drivers that already have specified a shutdown routine (drivers/input/misc/sparcspkr.c, drivers/usb/host/ohci-ppc-of.c and drivers/watchdog/mpc5200_wdt.c) are actually ok if it actually gets called. :-) Also, patches like this should be cc'd to (at least) the sparc guys ([EMAIL PROTECTED]) since they share this stuff with us, now. -- Cheers, Stephen Rothwell[EMAIL PROTECTED] http://www.canb.auug.org.au/~sfr/ pgpoKOfgtHzYD.pgp Description: PGP signature ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev