Skip to content

Commit

Permalink
ARM: sa1111: add shutdown hook to sa1111_driver structure
Browse files Browse the repository at this point in the history
Add a shutdown hook to the sa1111_driver structure to allow drivers
to be notified of system reboots and shutdowns.

Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Russell King committed Feb 9, 2012
1 parent 36d3121 commit 6bd72f0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions arch/arm/common/sa1111.c
Original file line number Diff line number Diff line change
Expand Up @@ -1348,6 +1348,14 @@ static int sa1111_bus_resume(struct device *dev)
return ret;
}

static void sa1111_bus_shutdown(struct device *dev)
{
struct sa1111_driver *drv = SA1111_DRV(dev->driver);

if (drv && drv->shutdown)
drv->shutdown(SA1111_DEV(dev));
}

static int sa1111_bus_probe(struct device *dev)
{
struct sa1111_dev *sadev = SA1111_DEV(dev);
Expand Down Expand Up @@ -1377,6 +1385,7 @@ struct bus_type sa1111_bus_type = {
.remove = sa1111_bus_remove,
.suspend = sa1111_bus_suspend,
.resume = sa1111_bus_resume,
.shutdown = sa1111_bus_shutdown,
};
EXPORT_SYMBOL(sa1111_bus_type);

Expand Down
1 change: 1 addition & 0 deletions arch/arm/include/asm/hardware/sa1111.h
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,7 @@ struct sa1111_driver {
int (*remove)(struct sa1111_dev *);
int (*suspend)(struct sa1111_dev *, pm_message_t);
int (*resume)(struct sa1111_dev *);
void (*shutdown)(struct sa1111_dev *);
};

#define SA1111_DRV(_d) container_of((_d), struct sa1111_driver, drv)
Expand Down

0 comments on commit 6bd72f0

Please sign in to comment.