iommu/qcom: Simplify getting .drvdata
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Thu, 19 Apr 2018 14:05:54 +0000 (16:05 +0200)
committerJoerg Roedel <jroedel@suse.de>
Thu, 3 May 2018 13:18:26 +0000 (15:18 +0200)
We should get drvdata from struct device directly. Going via
platform_device is an unneeded step back and forth.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/qcom_iommu.c

index 65b9c99..fe88a48 100644 (file)
@@ -885,16 +885,14 @@ static int qcom_iommu_device_remove(struct platform_device *pdev)
 
 static int __maybe_unused qcom_iommu_resume(struct device *dev)
 {
 
 static int __maybe_unused qcom_iommu_resume(struct device *dev)
 {
-       struct platform_device *pdev = to_platform_device(dev);
-       struct qcom_iommu_dev *qcom_iommu = platform_get_drvdata(pdev);
+       struct qcom_iommu_dev *qcom_iommu = dev_get_drvdata(dev);
 
        return qcom_iommu_enable_clocks(qcom_iommu);
 }
 
 static int __maybe_unused qcom_iommu_suspend(struct device *dev)
 {
 
        return qcom_iommu_enable_clocks(qcom_iommu);
 }
 
 static int __maybe_unused qcom_iommu_suspend(struct device *dev)
 {
-       struct platform_device *pdev = to_platform_device(dev);
-       struct qcom_iommu_dev *qcom_iommu = platform_get_drvdata(pdev);
+       struct qcom_iommu_dev *qcom_iommu = dev_get_drvdata(dev);
 
        qcom_iommu_disable_clocks(qcom_iommu);
 
 
        qcom_iommu_disable_clocks(qcom_iommu);