Skip to contentSkip to conversation

scsi: ufshcd: use devm_platform_ioremap_resource() to simplify code

PATCH Applied YueHaibing 3 participants 3 messages Sep 4, 2019 – Sep 7, 2019 SCSI

lore
Share & tools
lore

YueHaibing

author
#0 lore raw

PATCH 1/1 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.

---
 drivers/scsi/ufs/ufshcd-pltfrm.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/scsi/ufs/ufshcd-pltfrm.c +1 -3
index d7d521b..8d40dc9 100644
@@ -391,12 +391,10 @@ int ufshcd_pltfrm_init(struct platform_device *pdev,
 {
 	struct ufs_hba *hba;
 	void __iomem *mmio_base;
-	struct resource *mem_res;
 	int irq, err;
 	struct device *dev = &pdev->dev;
 
-	mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	mmio_base = devm_ioremap_resource(dev, mem_res);
+	mmio_base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(mmio_base)) {
 		err = PTR_ERR(mmio_base);
 		goto out;
Signature · 1 line
2.7.4
#2 lore raw
In reply to YueHaibing

YueHaibing,

Quoted 2 lines

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

Applied to 5.4/scsi-queue, thanks.

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering