]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
video: tegra: host: Rework public acm API
authorArto Merilainen <amerilainen@nvidia.com>
Thu, 13 Mar 2014 08:02:23 +0000 (10:02 +0200)
committerArto Merilainen <amerilainen@nvidia.com>
Tue, 25 Mar 2014 12:39:56 +0000 (05:39 -0700)
The public ACM API has this far required that it is called with the
client device, however, calling the functions with host1x device
should also be allowed. This patch removes the host1x client check.

Change-Id: I816883a49f5e85e35dab5bacb2ca8bb18db84922
Signed-off-by: Arto Merilainen <amerilainen@nvidia.com>
Reviewed-on: http://git-master/r/381421
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
drivers/video/tegra/host/nvhost_acm.c

index 36ddb2a422e33b40b274f7ea6c7cd63dccd5d605..003b221ec2e15b1be402f2458d53518f894bd967 100644 (file)
@@ -848,47 +848,23 @@ int nvhost_module_finalize_poweron(struct device *dev)
 /* public host1x power management APIs */
 bool nvhost_module_powered_ext(struct platform_device *dev)
 {
-       struct platform_device *pdev;
-
-       if (!nvhost_get_parent(dev)) {
-               dev_err(&dev->dev, "Module powered called with wrong dev\n");
-               return 0;
-       }
-
-       /* get the parent */
-       pdev = to_platform_device(dev->dev.parent);
-
-       return nvhost_module_powered(pdev);
+       if (dev->dev.parent && dev->dev.parent != &platform_bus)
+               dev = to_platform_device(dev->dev.parent);
+       return nvhost_module_powered(dev);
 }
 
 int nvhost_module_busy_ext(struct platform_device *dev)
 {
-       struct platform_device *pdev;
-
-       if (!nvhost_get_parent(dev)) {
-               dev_err(&dev->dev, "Module busy called with wrong dev\n");
-               return -EINVAL;
-       }
-
-       /* get the parent */
-       pdev = to_platform_device(dev->dev.parent);
-
-       return nvhost_module_busy(pdev);
+       if (dev->dev.parent && dev->dev.parent != &platform_bus)
+               dev = to_platform_device(dev->dev.parent);
+       return nvhost_module_busy(dev);
 }
 EXPORT_SYMBOL(nvhost_module_busy_ext);
 
 void nvhost_module_idle_ext(struct platform_device *dev)
 {
-       struct platform_device *pdev;
-
-       if (!nvhost_get_parent(dev)) {
-               dev_err(&dev->dev, "Module idle called with wrong dev\n");
-               return;
-       }
-
-       /* get the parent */
-       pdev = to_platform_device(dev->dev.parent);
-
-       nvhost_module_idle(pdev);
+       if (dev->dev.parent && dev->dev.parent != &platform_bus)
+               dev = to_platform_device(dev->dev.parent);
+       nvhost_module_idle(dev);
 }
 EXPORT_SYMBOL(nvhost_module_idle_ext);