diff options
author | Michael Ellerman <michael@ellerman.id.au> | 2008-01-25 00:59:13 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2008-02-06 00:29:59 -0500 |
commit | a09ad3c462e802f0a522969ce377820cfad89ee8 (patch) | |
tree | 719b029cb3e84988c3a736e0257a00c47d2fd480 /drivers/of/platform.c | |
parent | bb125fb0e09c1b1e17d0b616f0e31fea937af9f6 (diff) |
[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 <michael@ellerman.id.au>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'drivers/of/platform.c')
-rw-r--r-- | 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 b47bb2d7476a..ca09a63a64db 100644 --- a/drivers/of/platform.c +++ b/drivers/of/platform.c | |||
@@ -85,6 +85,15 @@ static int of_platform_device_resume(struct device * dev) | |||
85 | return error; | 85 | return error; |
86 | } | 86 | } |
87 | 87 | ||
88 | static void of_platform_device_shutdown(struct device *dev) | ||
89 | { | ||
90 | struct of_device *of_dev = to_of_device(dev); | ||
91 | struct of_platform_driver *drv = to_of_platform_driver(dev->driver); | ||
92 | |||
93 | if (dev->driver && drv->shutdown) | ||
94 | drv->shutdown(of_dev); | ||
95 | } | ||
96 | |||
88 | int of_bus_type_init(struct bus_type *bus, const char *name) | 97 | int of_bus_type_init(struct bus_type *bus, const char *name) |
89 | { | 98 | { |
90 | bus->name = name; | 99 | bus->name = name; |
@@ -93,6 +102,7 @@ int of_bus_type_init(struct bus_type *bus, const char *name) | |||
93 | bus->remove = of_platform_device_remove; | 102 | bus->remove = of_platform_device_remove; |
94 | bus->suspend = of_platform_device_suspend; | 103 | bus->suspend = of_platform_device_suspend; |
95 | bus->resume = of_platform_device_resume; | 104 | bus->resume = of_platform_device_resume; |
105 | bus->shutdown = of_platform_device_shutdown; | ||
96 | return bus_register(bus); | 106 | return bus_register(bus); |
97 | } | 107 | } |
98 | 108 | ||