diff mbox series

[-next] scsi: ufs-hisi: use devm_platform_ioremap_resource() to simplify code

Message ID 20190904130457.24744-1-yuehaibing@huawei.com (mailing list archive)
State Mainlined
Commit 7ce5eed0998c0b2884329a06f29d0251079fca62
Headers show
Series [-next] scsi: ufs-hisi: use devm_platform_ioremap_resource() to simplify code | expand

Commit Message

Yue Haibing Sept. 4, 2019, 1:04 p.m. UTC
Use devm_platform_ioremap_resource() to simplify the code a bit.
This is detected by coccinelle.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/scsi/ufs/ufs-hisi.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Avri Altman Sept. 4, 2019, 1:39 p.m. UTC | #1
> Use devm_platform_ioremap_resource() to simplify the code a bit.
> This is detected by coccinelle.
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Manivannan Sadhasivam Sept. 4, 2019, 7:49 p.m. UTC | #2
On 4 September 2019 6:34:57 PM IST, YueHaibing <yuehaibing@huawei.com> wrote:
>Use devm_platform_ioremap_resource() to simplify the code a bit.
>This is detected by coccinelle.
>
>Reported-by: Hulk Robot <hulkci@huawei.com>
>Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Acked-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

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);
>
Martin K. Petersen Sept. 7, 2019, 8:43 p.m. UTC | #3
YueHaibing,

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

Applied to 5.4/scsi-queue, thanks.
diff mbox series

Patch

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);