]> Git Repo - linux.git/commitdiff
iommu/qcom: Simplify getting .drvdata
authorWolfram Sang <[email protected]>
Thu, 19 Apr 2018 14:05:54 +0000 (16:05 +0200)
committerJoerg Roedel <[email protected]>
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 <[email protected]>
Signed-off-by: Joerg Roedel <[email protected]>
drivers/iommu/qcom_iommu.c

index 65b9c99707f84837aa0bb863ec211e08050ca005..fe88a4880d3af0fbd3eaa2953ffbc8f9f07fc23b 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)
 {
-       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)
 {
-       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);
 
This page took 0.059859 seconds and 4 git commands to generate.