All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Philipp Stanner <pstanner@redhat.com>
Cc: Jens Axboe <axboe@kernel.dk>, Wu Hao <hao.wu@intel.com>,
	Tom Rix <trix@redhat.com>, Moritz Fischer <mdf@kernel.org>,
	Xu Yilun <yilun.xu@intel.com>, Andy Shevchenko <andy@kernel.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Bartosz Golaszewski <brgl@bgdev.pl>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Richard Cochran <richardcochran@gmail.com>,
	Damien Le Moal <dlemoal@kernel.org>,
	Hannes Reinecke <hare@suse.de>, Al Viro <viro@zeniv.linux.org.uk>,
	Keith Busch <kbusch@kernel.org>, Li Zetao <lizetao1@huawei.com>,
	linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-fpga@vger.kernel.org, linux-gpio@vger.kernel.org,
	netdev@vger.kernel.org, linux-pci@vger.kernel.org,
	Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Subject: Re: [PATCH v7 4/5] gpio: Replace deprecated PCI functions
Date: Mon, 14 Oct 2024 13:13:24 +0100	[thread overview]
Message-ID: <20241014121324.GT77519@kernel.org> (raw)
In-Reply-To: <20241014075329.10400-5-pstanner@redhat.com>

On Mon, Oct 14, 2024 at 09:53:25AM +0200, Philipp Stanner wrote:
> pcim_iomap_regions() and pcim_iomap_table() have been deprecated by the
> PCI subsystem in commit e354bb84a4c1 ("PCI: Deprecate
> pcim_iomap_table(), pcim_iomap_regions_request_all()").
> 
> Replace those functions with calls to pcim_iomap_region().
> 
> Signed-off-by: Philipp Stanner <pstanner@redhat.com>
> Reviewed-by: Andy Shevchenko <andy@kernel.org>
> Acked-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> ---
>  drivers/gpio/gpio-merrifield.c | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/gpio/gpio-merrifield.c b/drivers/gpio/gpio-merrifield.c
> index 421d7e3a6c66..274afcba31e6 100644
> --- a/drivers/gpio/gpio-merrifield.c
> +++ b/drivers/gpio/gpio-merrifield.c
> @@ -78,24 +78,24 @@ static int mrfld_gpio_probe(struct pci_dev *pdev, const struct pci_device_id *id
>  	if (retval)
>  		return retval;
>  
> -	retval = pcim_iomap_regions(pdev, BIT(1) | BIT(0), pci_name(pdev));
> -	if (retval)
> -		return dev_err_probe(dev, retval, "I/O memory mapping error\n");
> -
> -	base = pcim_iomap_table(pdev)[1];
> +	base = pcim_iomap_region(pdev, 1, pci_name(pdev));
> +	if (IS_ERR(base))
> +		return dev_err_probe(dev, PTR_ERR(base), "I/O memory mapping error\n");
>  
>  	irq_base = readl(base + 0 * sizeof(u32));
>  	gpio_base = readl(base + 1 * sizeof(u32));
>  
>  	/* Release the IO mapping, since we already get the info from BAR1 */
> -	pcim_iounmap_regions(pdev, BIT(1));
> +	pcim_iounmap_region(pdev, 1);
>  
>  	priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
>  	if (!priv)
>  		return -ENOMEM;
>  
>  	priv->dev = dev;
> -	priv->reg_base = pcim_iomap_table(pdev)[0];
> +	priv->reg_base = pcim_iomap_region(pdev, 0, pci_name(pdev));
> +	if (IS_ERR(priv->reg_base))
> +		return dev_err_probe(dev, PTR_ERR(base), "I/O memory mapping error\n");

Hi Philipp,

There seems to be a mismatch in the use of priv->reg_base and base above.
Should the above use PTR_ERR(priv->reg_base) instead of PTR_ERR(base)?

>  
>  	priv->pin_info.pin_ranges = mrfld_gpio_ranges;
>  	priv->pin_info.nranges = ARRAY_SIZE(mrfld_gpio_ranges);
> -- 
> 2.46.2
> 
> 

  parent reply	other threads:[~2024-10-14 12:13 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-14  7:53 [PATCH v7 0/5] PCI: Remove most pcim_iounmap_regions() users Philipp Stanner
2024-10-14  7:53 ` [PATCH v7 1/5] PCI: Deprecate pcim_iounmap_regions() Philipp Stanner
2024-10-14  7:53 ` [PATCH v7 2/5] fpga/dfl-pci.c: Replace deprecated PCI functions Philipp Stanner
2024-10-14  7:53 ` [PATCH v7 3/5] block: mtip32xx: " Philipp Stanner
2024-10-14  7:53 ` [PATCH v7 4/5] gpio: " Philipp Stanner
2024-10-14  7:59   ` Bartosz Golaszewski
2024-10-14  8:08     ` Philipp Stanner
2024-10-14  8:15       ` Bartosz Golaszewski
2024-10-14  8:27         ` Philipp Stanner
2024-10-14 12:13   ` Simon Horman [this message]
2024-10-14 12:59     ` Philipp Stanner
2024-10-14  7:53 ` [PATCH v7 5/5] ethernet: cavium: " Philipp Stanner

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=20241014121324.GT77519@kernel.org \
    --to=horms@kernel.org \
    --cc=andy@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=bartosz.golaszewski@linaro.org \
    --cc=bhelgaas@google.com \
    --cc=brgl@bgdev.pl \
    --cc=davem@davemloft.net \
    --cc=dlemoal@kernel.org \
    --cc=edumazet@google.com \
    --cc=hao.wu@intel.com \
    --cc=hare@suse.de \
    --cc=kbusch@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-fpga@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lizetao1@huawei.com \
    --cc=mdf@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pstanner@redhat.com \
    --cc=richardcochran@gmail.com \
    --cc=trix@redhat.com \
    --cc=viro@zeniv.linux.org.uk \
    --cc=yilun.xu@intel.com \
    /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 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.