diff options
author | Yangtao Li <frank.li@vivo.com> | 2023-07-10 10:45:47 +0800 |
---|---|---|
committer | Damien Le Moal <dlemoal@kernel.org> | 2023-08-02 17:37:06 +0900 |
commit | b1aa998467c315228f3610da4fdfb455131692bb (patch) | |
tree | d869226d3e5bd5f28a05bf14011e084c7d7da93b /drivers/ata | |
parent | 08c046e23595b284d91afb9a704148d25a27dad6 (diff) | |
download | linux-b1aa998467c315228f3610da4fdfb455131692bb.tar.gz linux-b1aa998467c315228f3610da4fdfb455131692bb.tar.bz2 linux-b1aa998467c315228f3610da4fdfb455131692bb.zip |
ata: pata_ixp4xx: Use devm_platform_get_and_ioremap_resource()
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>
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Diffstat (limited to 'drivers/ata')
-rw-r--r-- | drivers/ata/pata_ixp4xx_cf.c | 17 |
1 files 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) |