From: Yangtao Li <frank.li@vivo.com>
To: Sergey Shtylyov <s.shtylyov@omp.ru>, Damien Le Moal <dlemoal@kernel.org>
Cc: Yangtao Li <frank.li@vivo.com>,
linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v3 08/11] ata: pata_ixp4xx: Use devm_platform_get_and_ioremap_resource()
Date: Mon, 10 Jul 2023 10:45:47 +0800 [thread overview]
Message-ID: <20230710024550.59544-8-frank.li@vivo.com> (raw)
In-Reply-To: <20230710024550.59544-1-frank.li@vivo.com>
Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>
---
drivers/ata/pata_ixp4xx_cf.c | 17 +++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)
diff --git a/drivers/ata/pata_ixp4xx_cf.c b/drivers/ata/pata_ixp4xx_cf.c
index b1daa4d3fcd9..1b9f67e16864 100644
--- a/drivers/ata/pata_ixp4xx_cf.c
+++ b/drivers/ata/pata_ixp4xx_cf.c
@@ -242,12 +242,6 @@ static int ixp4xx_pata_probe(struct platform_device *pdev)
int ret;
int irq;
- cmd = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- ctl = platform_get_resource(pdev, IORESOURCE_MEM, 1);
-
- if (!cmd || !ctl)
- return -EINVAL;
-
ixpp = devm_kzalloc(dev, sizeof(*ixpp), GFP_KERNEL);
if (!ixpp)
return -ENOMEM;
@@ -271,10 +265,13 @@ static int ixp4xx_pata_probe(struct platform_device *pdev)
if (ret)
return ret;
- ixpp->cmd = devm_ioremap_resource(dev, cmd);
- ixpp->ctl = devm_ioremap_resource(dev, ctl);
- if (IS_ERR(ixpp->cmd) || IS_ERR(ixpp->ctl))
- return -ENOMEM;
+ ixpp->cmd = devm_platform_get_and_ioremap_resource(pdev, 0, &cmd);
+ if (IS_ERR(ixpp->cmd))
+ return PTR_ERR(ixpp->cmd);
+
+ ixpp->ctl = devm_platform_get_and_ioremap_resource(pdev, 1, &ctl);
+ if (IS_ERR(ixpp->ctl))
+ return PTR_ERR(ixpp->ctl);
irq = platform_get_irq(pdev, 0);
if (irq > 0)
--
2.39.0
next prev parent reply other threads:[~2023-07-10 2:47 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-10 2:45 [PATCH v3 01/11] ata: ahci_octeon: Convert to devm_platform_ioremap_resource() Yangtao Li
2023-07-10 2:45 ` [PATCH v3 02/11] ata: ahci_seattle: " Yangtao Li
2023-07-10 2:45 ` [PATCH v3 03/11] ata: ahci_xgene: " Yangtao Li
2023-07-10 2:45 ` [PATCH v3 04/11] ata: ahci_tegra: " Yangtao Li
2023-07-10 2:45 ` [PATCH v3 05/11] ata: sata_rcar: drop useless initializer Yangtao Li
2023-07-10 12:28 ` Geert Uytterhoeven
2023-07-10 2:45 ` [PATCH v3 06/11] ata: sata_rcar: Remove unnecessary return value check Yangtao Li
2023-07-10 12:29 ` Geert Uytterhoeven
2023-07-10 2:45 ` [PATCH v3 07/11] ata: sata_rcar: Convert to devm_platform_ioremap_resource() Yangtao Li
2023-07-10 12:29 ` Geert Uytterhoeven
2023-07-10 2:45 ` Yangtao Li [this message]
2023-07-10 2:45 ` [PATCH v3 09/11] ata: pata_ixp4xx: Remove unnecessary return value check Yangtao Li
2023-07-10 2:45 ` [PATCH v3 10/11] ata: pata_ftide010: Use devm_platform_get_and_ioremap_resource() Yangtao Li
2023-07-10 2:45 ` [PATCH v3 11/11] ata: pata_imx: " Yangtao Li
2023-07-17 0:44 ` [PATCH v3 01/11] ata: ahci_octeon: Convert to devm_platform_ioremap_resource() Damien Le Moal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230710024550.59544-8-frank.li@vivo.com \
--to=frank.li@vivo.com \
--cc=dlemoal@kernel.org \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=s.shtylyov@omp.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®