aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2012-01-26 06:01:18 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2012-02-09 10:34:50 -0500
commit6bd72f0562142ddae26a052cfc4e578ad6953d06 (patch)
tree0f23bed8b44dba93ecab8f79c48e2f934423658f /arch
parent36d312130228504a223de44739c807b0353248c1 (diff)
ARM: sa1111: add shutdown hook to sa1111_driver structure
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>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/common/sa1111.c9
-rw-r--r--arch/arm/include/asm/hardware/sa1111.h1
2 files changed, 10 insertions, 0 deletions
diff --git a/arch/arm/common/sa1111.c b/arch/arm/common/sa1111.c
index b64a3360c8c2..b0f93628dcd7 100644
--- a/arch/arm/common/sa1111.c
+++ b/arch/arm/common/sa1111.c
@@ -1348,6 +1348,14 @@ static int sa1111_bus_resume(struct device *dev)
1348 return ret; 1348 return ret;
1349} 1349}
1350 1350
1351static void sa1111_bus_shutdown(struct device *dev)
1352{
1353 struct sa1111_driver *drv = SA1111_DRV(dev->driver);
1354
1355 if (drv && drv->shutdown)
1356 drv->shutdown(SA1111_DEV(dev));
1357}
1358
1351static int sa1111_bus_probe(struct device *dev) 1359static int sa1111_bus_probe(struct device *dev)
1352{ 1360{
1353 struct sa1111_dev *sadev = SA1111_DEV(dev); 1361 struct sa1111_dev *sadev = SA1111_DEV(dev);
@@ -1377,6 +1385,7 @@ struct bus_type sa1111_bus_type = {
1377 .remove = sa1111_bus_remove, 1385 .remove = sa1111_bus_remove,
1378 .suspend = sa1111_bus_suspend, 1386 .suspend = sa1111_bus_suspend,
1379 .resume = sa1111_bus_resume, 1387 .resume = sa1111_bus_resume,
1388 .shutdown = sa1111_bus_shutdown,
1380}; 1389};
1381EXPORT_SYMBOL(sa1111_bus_type); 1390EXPORT_SYMBOL(sa1111_bus_type);
1382 1391
diff --git a/arch/arm/include/asm/hardware/sa1111.h b/arch/arm/include/asm/hardware/sa1111.h
index 92ed254c175b..29e320f6f85f 100644
--- a/arch/arm/include/asm/hardware/sa1111.h
+++ b/arch/arm/include/asm/hardware/sa1111.h
@@ -548,6 +548,7 @@ struct sa1111_driver {
548 int (*remove)(struct sa1111_dev *); 548 int (*remove)(struct sa1111_dev *);
549 int (*suspend)(struct sa1111_dev *, pm_message_t); 549 int (*suspend)(struct sa1111_dev *, pm_message_t);
550 int (*resume)(struct sa1111_dev *); 550 int (*resume)(struct sa1111_dev *);
551 void (*shutdown)(struct sa1111_dev *);
551}; 552};
552 553
553#define SA1111_DRV(_d) container_of((_d), struct sa1111_driver, drv) 554#define SA1111_DRV(_d) container_of((_d), struct sa1111_driver, drv)