public inbox for linux-ide@vger.kernel.org
 help / color / mirror / Atom feed
From: Damien Le Moal <dlemoal@kernel.org>
To: Yangtao Li <frank.li@vivo.com>, Sergey Shtylyov <s.shtylyov@omp.ru>
Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 6/8] pata: ixp4xx: Use devm_platform_get_and_ioremap_resource()
Date: Fri, 7 Jul 2023 08:39:41 +0900	[thread overview]
Message-ID: <9549562b-e6ce-15df-571a-bdb6a84bdb03@kernel.org> (raw)
In-Reply-To: <20230706124239.23366-6-frank.li@vivo.com>

On 7/6/23 21:42, Yangtao Li wrote:
> 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.

Patch title:

ata: pata_ixp4xx: ...

> 
> Signed-off-by: Yangtao Li <frank.li@vivo.com>
> ---
>  drivers/ata/pata_ixp4xx_cf.c | 24 +++++++++---------------
>  1 file changed, 9 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/ata/pata_ixp4xx_cf.c b/drivers/ata/pata_ixp4xx_cf.c
> index b1daa4d3fcd9..246bb4f8f1f7 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,18 +265,18 @@ 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)
> -		irq_set_irq_type(irq, IRQ_TYPE_EDGE_RISING);
> -	else if (irq < 0)
> +	if (irq < 0)
>  		return irq;
> -	else
> -		return -EINVAL;
> +	irq_set_irq_type(irq, IRQ_TYPE_EDGE_RISING);

This change is OK but this should be a different patch.

>  
>  	/* Just one port to set up */
>  	ixp4xx_setup_port(ixpp->host->ports[0], ixpp, cmd->start, ctl->start);

-- 
Damien Le Moal
Western Digital Research


  reply	other threads:[~2023-07-06 23:39 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-06 12:42 [PATCH 1/8] ata: ahci_octeon: Convert to devm_platform_ioremap_resource() Yangtao Li
2023-07-06 12:42 ` [PATCH 2/8] ata: ahci_seattle: " Yangtao Li
2023-07-06 12:42 ` [PATCH 3/8] ata: ahci_xgene: " Yangtao Li
2023-07-06 12:42 ` [PATCH 4/8] ahci: tegra: " Yangtao Li
2023-07-06 23:35   ` Damien Le Moal
2023-07-06 12:42 ` [PATCH 5/8] ata: sata_rcar: " Yangtao Li
2023-07-06 13:05   ` Geert Uytterhoeven
2023-07-06 21:10   ` Sergey Shtylyov
2023-07-06 23:37   ` Damien Le Moal
2023-07-06 12:42 ` [PATCH 6/8] pata: ixp4xx: Use devm_platform_get_and_ioremap_resource() Yangtao Li
2023-07-06 23:39   ` Damien Le Moal [this message]
2023-07-07 18:58   ` Sergey Shtylyov
2023-07-06 12:42 ` [PATCH 7/8] ata: pata_ftide010: " Yangtao Li
2023-07-06 18:02   ` Linus Walleij
2023-07-06 21:19   ` Sergey Shtylyov
2023-07-06 12:42 ` [PATCH 8/8] pata: imx: " Yangtao Li
2023-07-06 21:21   ` Sergey Shtylyov
2023-07-06 23:40   ` 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=9549562b-e6ce-15df-571a-bdb6a84bdb03@kernel.org \
    --to=dlemoal@kernel.org \
    --cc=frank.li@vivo.com \
    --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