2019-09-04 13:06:58

by Yue Haibing

[permalink] [raw]
Subject: [PATCH -next] scsi: ufs-hisi: use devm_platform_ioremap_resource() to simplify code

Use devm_platform_ioremap_resource() to simplify the code a bit.
This is detected by coccinelle.

Reported-by: Hulk Robot <[email protected]>
Signed-off-by: YueHaibing <[email protected]>
---
drivers/scsi/ufs/ufs-hisi.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/scsi/ufs/ufs-hisi.c b/drivers/scsi/ufs/ufs-hisi.c
index f4d1dca..6bbb167 100644
--- a/drivers/scsi/ufs/ufs-hisi.c
+++ b/drivers/scsi/ufs/ufs-hisi.c
@@ -447,13 +447,11 @@ static int ufs_hisi_resume(struct ufs_hba *hba, enum ufs_pm_op pm_op)

static int ufs_hisi_get_resource(struct ufs_hisi_host *host)
{
- struct resource *mem_res;
struct device *dev = host->hba->dev;
struct platform_device *pdev = to_platform_device(dev);

/* get resource of ufs sys ctrl */
- mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
- host->ufs_sys_ctrl = devm_ioremap_resource(dev, mem_res);
+ host->ufs_sys_ctrl = devm_platform_ioremap_resource(pdev, 1);
if (IS_ERR(host->ufs_sys_ctrl))
return PTR_ERR(host->ufs_sys_ctrl);

--
2.7.4



2019-09-04 13:41:52

by Avri Altman

[permalink] [raw]
Subject: RE: [PATCH -next] scsi: ufs-hisi: use devm_platform_ioremap_resource() to simplify code


> Use devm_platform_ioremap_resource() to simplify the code a bit.
> This is detected by coccinelle.
>
> Reported-by: Hulk Robot <[email protected]>
> Signed-off-by: YueHaibing <[email protected]>
Reviewed-by: Avri Altman <[email protected]>

2019-09-04 19:51:02

by Manivannan Sadhasivam

[permalink] [raw]
Subject: Re: [PATCH -next] scsi: ufs-hisi: use devm_platform_ioremap_resource() to simplify code



On 4 September 2019 6:34:57 PM IST, YueHaibing <[email protected]> wrote:
>Use devm_platform_ioremap_resource() to simplify the code a bit.
>This is detected by coccinelle.
>
>Reported-by: Hulk Robot <[email protected]>
>Signed-off-by: YueHaibing <[email protected]>

Acked-by: Manivannan Sadhasivam <[email protected]>

Thanks,
Mani
>---
> drivers/scsi/ufs/ufs-hisi.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
>diff --git a/drivers/scsi/ufs/ufs-hisi.c b/drivers/scsi/ufs/ufs-hisi.c
>index f4d1dca..6bbb167 100644
>--- a/drivers/scsi/ufs/ufs-hisi.c
>+++ b/drivers/scsi/ufs/ufs-hisi.c
>@@ -447,13 +447,11 @@ static int ufs_hisi_resume(struct ufs_hba *hba,
>enum ufs_pm_op pm_op)
>
> static int ufs_hisi_get_resource(struct ufs_hisi_host *host)
> {
>- struct resource *mem_res;
> struct device *dev = host->hba->dev;
> struct platform_device *pdev = to_platform_device(dev);
>
> /* get resource of ufs sys ctrl */
>- mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
>- host->ufs_sys_ctrl = devm_ioremap_resource(dev, mem_res);
>+ host->ufs_sys_ctrl = devm_platform_ioremap_resource(pdev, 1);
> if (IS_ERR(host->ufs_sys_ctrl))
> return PTR_ERR(host->ufs_sys_ctrl);
>

--
Sent from my Android device with K-9 Mail. Please excuse my brevity.

2019-09-09 06:55:31

by Martin K. Petersen

[permalink] [raw]
Subject: Re: [PATCH -next] scsi: ufs-hisi: use devm_platform_ioremap_resource() to simplify code


YueHaibing,

> Use devm_platform_ioremap_resource() to simplify the code a bit.
> This is detected by coccinelle.

Applied to 5.4/scsi-queue, thanks.

--
Martin K. Petersen Oracle Linux Engineering