2014-10-10 13:33:35

by Kiran Padwal

[permalink] [raw]
Subject: [PATCH] iommu: use dev_get_platdata()

Use the wrapper function for retrieving the platform data instead of
accessing dev->platform_data directly.

Signed-off-by: Kiran Padwal <[email protected]>
---
drivers/iommu/msm_iommu_dev.c | 4 ++--
drivers/iommu/omap-iommu.c | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/iommu/msm_iommu_dev.c b/drivers/iommu/msm_iommu_dev.c
index 61def7cb..6b16c5c 100644
--- a/drivers/iommu/msm_iommu_dev.c
+++ b/drivers/iommu/msm_iommu_dev.c
@@ -131,7 +131,7 @@ static int msm_iommu_probe(struct platform_device *pdev)
struct clk *iommu_clk;
struct clk *iommu_pclk;
struct msm_iommu_drvdata *drvdata;
- struct msm_iommu_dev *iommu_dev = pdev->dev.platform_data;
+ struct msm_iommu_dev *iommu_dev = dev_get_platdata(&pdev->dev);
void __iomem *regs_base;
int ret, irq, par;

@@ -264,7 +264,7 @@ static int msm_iommu_remove(struct platform_device *pdev)

static int msm_iommu_ctx_probe(struct platform_device *pdev)
{
- struct msm_iommu_ctx_dev *c = pdev->dev.platform_data;
+ struct msm_iommu_ctx_dev *c = dev_get_platdata(&pdev->dev);
struct msm_iommu_drvdata *drvdata;
struct msm_iommu_ctx_drvdata *ctx_drvdata;
int i, ret;
diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c
index 3627887..fb9ab86 100644
--- a/drivers/iommu/omap-iommu.c
+++ b/drivers/iommu/omap-iommu.c
@@ -151,7 +151,7 @@ static int iommu_enable(struct omap_iommu *obj)
{
int err;
struct platform_device *pdev = to_platform_device(obj->dev);
- struct iommu_platform_data *pdata = pdev->dev.platform_data;
+ struct iommu_platform_data *pdata = dev_get_platdata(&pdev->dev);

if (!arch_iommu)
return -ENODEV;
@@ -174,7 +174,7 @@ static int iommu_enable(struct omap_iommu *obj)
static void iommu_disable(struct omap_iommu *obj)
{
struct platform_device *pdev = to_platform_device(obj->dev);
- struct iommu_platform_data *pdata = pdev->dev.platform_data;
+ struct iommu_platform_data *pdata = dev_get_platdata(&pdev->dev);

arch_iommu->disable(obj);

@@ -934,7 +934,7 @@ static int omap_iommu_probe(struct platform_device *pdev)
int irq;
struct omap_iommu *obj;
struct resource *res;
- struct iommu_platform_data *pdata = pdev->dev.platform_data;
+ struct iommu_platform_data *pdata = dev_get_platdata(&pdev->dev);
struct device_node *of = pdev->dev.of_node;

obj = devm_kzalloc(&pdev->dev, sizeof(*obj) + MMU_REG_SIZE, GFP_KERNEL);
--
1.7.9.5


2014-10-22 14:30:25

by Joerg Roedel

[permalink] [raw]
Subject: Re: [PATCH] iommu: use dev_get_platdata()

On Fri, Oct 10, 2014 at 07:01:10PM +0530, Kiran Padwal wrote:
> Use the wrapper function for retrieving the platform data instead of
> accessing dev->platform_data directly.
>
> Signed-off-by: Kiran Padwal <[email protected]>
> ---
> drivers/iommu/msm_iommu_dev.c | 4 ++--
> drivers/iommu/omap-iommu.c | 6 +++---
> 2 files changed, 5 insertions(+), 5 deletions(-)

This touches 2 drivers, can you please split it up into per-driver
patches?

Thanks,

Joerg

2014-10-28 09:58:12

by Kiran Padwal

[permalink] [raw]
Subject: Re: [PATCH] iommu: use dev_get_platdata()



On Wednesday, October 22, 2014 10:30am, "Joerg Roedel" <[email protected]> said:

> On Fri, Oct 10, 2014 at 07:01:10PM +0530, Kiran Padwal wrote:
>> Use the wrapper function for retrieving the platform data instead of
>> accessing dev->platform_data directly.
>>
>> Signed-off-by: Kiran Padwal <[email protected]>
>> ---
>> drivers/iommu/msm_iommu_dev.c | 4 ++--
>> drivers/iommu/omap-iommu.c | 6 +++---
>> 2 files changed, 5 insertions(+), 5 deletions(-)
>
> This touches 2 drivers, can you please split it up into per-driver
> patches?

Sure, I will resent the separate patches.
sorry for delayed response.

Thanks,
--Kiran