diff mbox series

[-next] ata: ahci_brcm: use devm_platform_ioremap_resource_byname

Message ID 20200917090840.107802-1-zhangqilong3@huawei.com
State Not Applicable
Delegated to: David Miller
Headers show
Series [-next] ata: ahci_brcm: use devm_platform_ioremap_resource_byname | expand

Commit Message

Zhang Qilong Sept. 17, 2020, 9:08 a.m. UTC
From: Zhang Qilong <zhangqilong3@huawei.com>

Use the devm_platform_ioremap_resource_byname() helper instead of
calling platform_get_resource_byname() and devm_ioremap_resource()
separately.

Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
---
 drivers/ata/ahci_brcm.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/drivers/ata/ahci_brcm.c b/drivers/ata/ahci_brcm.c
index 49f7acbfcf01..13cdc45695f9 100644
--- a/drivers/ata/ahci_brcm.c
+++ b/drivers/ata/ahci_brcm.c
@@ -431,7 +431,6 @@  static int brcm_ahci_probe(struct platform_device *pdev)
 	const char *reset_name = NULL;
 	struct brcm_ahci_priv *priv;
 	struct ahci_host_priv *hpriv;
-	struct resource *res;
 	int ret;
 
 	priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
@@ -445,8 +444,7 @@  static int brcm_ahci_probe(struct platform_device *pdev)
 	priv->version = (enum brcm_ahci_version)of_id->data;
 	priv->dev = dev;
 
-	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "top-ctrl");
-	priv->top_ctrl = devm_ioremap_resource(dev, res);
+	priv->top_ctrl = devm_platform_ioremap_resource_byname(pdev, "top-ctrl");
 	if (IS_ERR(priv->top_ctrl))
 		return PTR_ERR(priv->top_ctrl);