Skip to content

Commit

Permalink
[POWERPC] Create and hook up of_platform_device_shutdown
Browse files Browse the repository at this point in the history
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]>
Signed-off-by: Paul Mackerras <[email protected]>
  • Loading branch information
mpe authored and paulusmack committed Feb 6, 2008
1 parent bb125fb commit a09ad3c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions drivers/of/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
}

Expand Down

0 comments on commit a09ad3c

Please sign in to comment.