From: Michael Ellerman Date: Fri, 25 Jan 2008 05:59:13 +0000 (+1100) Subject: [POWERPC] Create and hook up of_platform_device_shutdown X-Git-Tag: v2.6.25-rc1~303^2~37 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=a09ad3c462e802f0a522969ce377820cfad89ee8;p=linux-2.6-omap-h63xx.git [POWERPC] 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 Acked-by: Benjamin Herrenschmidt Signed-off-by: Paul Mackerras --- diff --git a/drivers/of/platform.c b/drivers/of/platform.c index b47bb2d7476..ca09a63a64d 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); }