Commit 0b275551 authored by YueHaibing's avatar YueHaibing Committed by Martin K. Petersen

scsi: ufshcd: use devm_platform_ioremap_resource() to simplify code

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

Link: https://lore.kernel.org/r/20190904130348.24772-1-yuehaibing@huawei.comReported-by: default avatarHulk Robot <hulkci@huawei.com>
Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
Reviewed-by: default avatarAvri Altman <avri.altman@wdc.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent c0c1a71e
...@@ -391,12 +391,10 @@ int ufshcd_pltfrm_init(struct platform_device *pdev, ...@@ -391,12 +391,10 @@ int ufshcd_pltfrm_init(struct platform_device *pdev,
{ {
struct ufs_hba *hba; struct ufs_hba *hba;
void __iomem *mmio_base; void __iomem *mmio_base;
struct resource *mem_res;
int irq, err; int irq, err;
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); mmio_base = devm_platform_ioremap_resource(pdev, 0);
mmio_base = devm_ioremap_resource(dev, mem_res);
if (IS_ERR(mmio_base)) { if (IS_ERR(mmio_base)) {
err = PTR_ERR(mmio_base); err = PTR_ERR(mmio_base);
goto out; goto out;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment