summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMayuresh Kulkarni <mkulkarni@nvidia.com>2012-03-05 12:31:36 +0530
committerSimone Willett <swillett@nvidia.com>2012-03-07 22:23:04 -0800
commitde0e16ec268bc642be640762a315863291fce1ae (patch)
treedf50a517c83d13651e62c5e67572fbc21f306674 /include
parent64e110a41e2ac7de052d1f02b54efdd962864fdd (diff)
video: tegra: host: make nvhost_get_host inline
- nvhost_get_host returns host1x's master driver's private data - this host1x master is parent for all its modules. however, it does not have a parent of its own - so the debug_not_idle causes crash when there is an outstanding reference count on host1x by some module during suspend sequence - with this change, debug_not_idle returns error to pm core if host1x has an outstanding ref count. pm core then safely aborts the suspend and does resume Bug 947617 Change-Id: Ia2479c192bdd94028d090168f689823658062fd4 Signed-off-by: Mayuresh Kulkarni <mkulkarni@nvidia.com> Reviewed-on: http://git-master/r/87658 Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/nvhost.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/include/linux/nvhost.h b/include/linux/nvhost.h
index 739b6cc1c9ec..80f257ac6684 100644
--- a/include/linux/nvhost.h
+++ b/include/linux/nvhost.h
@@ -99,6 +99,7 @@ struct nvhost_device {
/* Register device to nvhost bus */
extern int nvhost_device_register(struct nvhost_device *);
+
/* Deregister device from nvhost bus */
extern void nvhost_device_unregister(struct nvhost_device *);
@@ -128,8 +129,12 @@ extern int nvhost_get_irq_byname(struct nvhost_device *, const char *);
#define nvhost_get_drvdata(_dev) dev_get_drvdata(&(_dev)->dev)
#define nvhost_set_drvdata(_dev, data) dev_set_drvdata(&(_dev)->dev, (data))
-#define nvhost_get_host(_dev) ((struct nvhost_master *) \
- dev_get_drvdata((_dev)->dev.parent))
+static inline struct nvhost_master *nvhost_get_host(struct nvhost_device *_dev)
+{
+ return (_dev->dev.parent) ? \
+ ((struct nvhost_master *) dev_get_drvdata(_dev->dev.parent)) : \
+ ((struct nvhost_master *) dev_get_drvdata(&(_dev->dev)));
+}
int nvhost_bus_add_host(struct nvhost_master *host);