diff options
author | Kevin Hilman <khilman@ti.com> | 2012-07-10 20:13:16 +0200 |
---|---|---|
committer | Kevin Hilman <khilman@ti.com> | 2012-09-12 19:51:49 +0200 |
commit | e753345bec8fef81d1e87710917f89dc75f39b2a (patch) | |
tree | 16ea644456b7caf76baf9bae2fb9c9228778a2cb /arch/arm/plat-omap/omap_device.c | |
parent | Linux 3.6-rc1 (diff) | |
download | linux-e753345bec8fef81d1e87710917f89dc75f39b2a.tar.xz linux-e753345bec8fef81d1e87710917f89dc75f39b2a.zip |
ARM: OMAP: omap_device: keep track of driver bound status
Use the bus notifier to keep track of driver bound status by adding a
new internal field to struct omap_device: _driver_status.
This will be useful for follow-up patches which need to know whether
or not a driver is bound in order to make intelligent omap_device
enable/idle decisions.
Reviewed-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
Diffstat (limited to 'arch/arm/plat-omap/omap_device.c')
-rw-r--r-- | arch/arm/plat-omap/omap_device.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c index c490240bb82c..1d1b5ff78306 100644 --- a/arch/arm/plat-omap/omap_device.c +++ b/arch/arm/plat-omap/omap_device.c @@ -385,17 +385,21 @@ static int _omap_device_notifier_call(struct notifier_block *nb, unsigned long event, void *dev) { struct platform_device *pdev = to_platform_device(dev); + struct omap_device *od; switch (event) { - case BUS_NOTIFY_ADD_DEVICE: - if (pdev->dev.of_node) - omap_device_build_from_dt(pdev); - break; - case BUS_NOTIFY_DEL_DEVICE: if (pdev->archdata.od) omap_device_delete(pdev->archdata.od); break; + case BUS_NOTIFY_ADD_DEVICE: + if (pdev->dev.of_node) + omap_device_build_from_dt(pdev); + /* fall through */ + default: + od = to_omap_device(pdev); + if (od) + od->_driver_status = event; } return NOTIFY_DONE; |