From: Russell King Date: Thu, 26 Jan 2012 11:01:18 +0000 (+0000) Subject: ARM: sa1111: add shutdown hook to sa1111_driver structure X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=6bd72f0562142ddae26a052cfc4e578ad6953d06;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git 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 Signed-off-by: Russell King --- 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) 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); @@ -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); 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 { 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)