]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
scsi: hisi_sas: use devm_platform_ioremap_resource() to simplify code
authorYueHaibing <yuehaibing@huawei.com>
Wed, 4 Sep 2019 13:02:56 +0000 (21:02 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Sat, 7 Sep 2019 20:40:56 +0000 (16:40 -0400)
Use devm_platform_ioremap_resource() to simplify the code a bit.
This is detected by coccinelle.

Link: https://lore.kernel.org/r/20190904130256.24704-1-yuehaibing@huawei.com
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Acked-by: John Garry <john.garry@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/hisi_sas/hisi_sas_main.c

index d60eaaa4c5e893d103b03907d19ac9147b0d280f..d34e398d4a5d121c674884e4f6720d565d5aed60 100644 (file)
@@ -2579,8 +2579,7 @@ static struct Scsi_Host *hisi_sas_shost_alloc(struct platform_device *pdev,
                goto err_out;
        }
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       hisi_hba->regs = devm_ioremap_resource(dev, res);
+       hisi_hba->regs = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(hisi_hba->regs))
                goto err_out;