video: tegra: host: Fix nvhost_device_data parse in case of DT
Min-wuk Lee [Thu, 16 May 2013 06:32:04 +0000 (15:32 +0900)]
If host1x and its client are registered by device tree,
fix of parsing nvhost_device_data in vi module is needed.
Both DT and non-DT can utilize general platform_get_drvdata

Bug 1240921

Change-Id: I2ac2105091b864f8c5bf83f24cb747998f4f0be9
Signed-off-by: Min-wuk Lee <mlee@nvidia.com>
Reviewed-on: http://git-master/r/229222
Reviewed-by: Mayuresh Kulkarni <mkulkarni@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>

drivers/video/tegra/host/vi/vi.c

index 2c92eb8..0669b4e 100644 (file)
@@ -80,7 +80,7 @@ static int __exit vi_remove(struct platform_device *dev)
 #ifdef CONFIG_TEGRA_CAMERA
        int err = 0;
        struct nvhost_device_data *pdata =
-               (struct nvhost_device_data *)dev->dev.platform_data;
+               (struct nvhost_device_data *)platform_get_drvdata(dev);
        struct vi *tegra_vi = (struct vi *)pdata->private_data;
 #endif
 
@@ -100,7 +100,7 @@ static int vi_suspend(struct platform_device *dev, pm_message_t state)
 {
 #ifdef CONFIG_TEGRA_CAMERA
        struct nvhost_device_data *pdata =
-               (struct nvhost_device_data *)dev->dev.platform_data;
+               (struct nvhost_device_data *)platform_get_drvdata(dev);
        struct vi *tegra_vi = (struct vi *)pdata->private_data;
 #endif
 
@@ -117,7 +117,7 @@ static int vi_resume(struct platform_device *dev)
 {
 #ifdef CONFIG_TEGRA_CAMERA
        struct nvhost_device_data *pdata =
-               (struct nvhost_device_data *)dev->dev.platform_data;
+               (struct nvhost_device_data *)platform_get_drvdata(dev);
 
        struct vi *tegra_vi = (struct vi *)pdata->private_data;
 #endif