* [PATCH] ata: libata: Use devm_platform_ioremap_resource_byname() helper function
@ 2024-08-27 7:20 Zhang Zekun
2024-08-27 7:53 ` Damien Le Moal
0 siblings, 1 reply; 2+ messages in thread
From: Zhang Zekun @ 2024-08-27 7:20 UTC (permalink / raw)
To: dlemoal, cassel, linux-ide; +Cc: zhangzekun11
platform_get_resource_byname() and devm_ioremap_resource() can be
replaced by devm_platform_ioremap_resource_byname(), which can
simplify the code logic a bit, No functional change here.
Signed-off-by: Zhang Zekun <zhangzekun11@huawei.com>
---
drivers/ata/ahci_brcm.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/ata/ahci_brcm.c b/drivers/ata/ahci_brcm.c
index 70c3a33eee6f..2f16524c2526 100644
--- a/drivers/ata/ahci_brcm.c
+++ b/drivers/ata/ahci_brcm.c
@@ -437,7 +437,6 @@ static int brcm_ahci_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev;
struct brcm_ahci_priv *priv;
struct ahci_host_priv *hpriv;
- struct resource *res;
int ret;
priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
@@ -451,8 +450,7 @@ static int brcm_ahci_probe(struct platform_device *pdev)
priv->version = (unsigned long)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);
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ata: libata: Use devm_platform_ioremap_resource_byname() helper function
2024-08-27 7:20 [PATCH] ata: libata: Use devm_platform_ioremap_resource_byname() helper function Zhang Zekun
@ 2024-08-27 7:53 ` Damien Le Moal
0 siblings, 0 replies; 2+ messages in thread
From: Damien Le Moal @ 2024-08-27 7:53 UTC (permalink / raw)
To: Zhang Zekun, cassel, linux-ide
On 8/27/24 16:20, Zhang Zekun wrote:
> platform_get_resource_byname() and devm_ioremap_resource() can be
> replaced by devm_platform_ioremap_resource_byname(), which can
> simplify the code logic a bit, No functional change here.
>
> Signed-off-by: Zhang Zekun <zhangzekun11@huawei.com>
Looks good, but since this modifies the ahci_brcm driver, the patch title should be:
ata: ahci_brcm: Use devm_platform_ioremap_resource_byname() helper function
Please resend with that fixed.
> ---
> drivers/ata/ahci_brcm.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/ata/ahci_brcm.c b/drivers/ata/ahci_brcm.c
> index 70c3a33eee6f..2f16524c2526 100644
> --- a/drivers/ata/ahci_brcm.c
> +++ b/drivers/ata/ahci_brcm.c
> @@ -437,7 +437,6 @@ static int brcm_ahci_probe(struct platform_device *pdev)
> struct device *dev = &pdev->dev;
> struct brcm_ahci_priv *priv;
> struct ahci_host_priv *hpriv;
> - struct resource *res;
> int ret;
>
> priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
> @@ -451,8 +450,7 @@ static int brcm_ahci_probe(struct platform_device *pdev)
> priv->version = (unsigned long)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);
>
--
Damien Le Moal
Western Digital Research
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-08-27 7:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-27 7:20 [PATCH] ata: libata: Use devm_platform_ioremap_resource_byname() helper function Zhang Zekun
2024-08-27 7:53 ` Damien Le Moal
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.