linux-fpga.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Philipp Stanner <pstanner@redhat.com>
To: Simon Horman <horms@kernel.org>
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 14:59:17 +0200	[thread overview]
Message-ID: <ae39d2783db4ecadd69a7e85d92ebe45c626bd62.camel@redhat.com> (raw)
In-Reply-To: <20241014121324.GT77519@kernel.org>

On Mon, 2024-10-14 at 13:13 +0100, Simon Horman wrote:
> 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)?

uff, yes, good catch!
Will fix, thx

P.

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


  reply	other threads:[~2024-10-14 12:59 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
2024-10-14 12:59     ` Philipp Stanner [this message]
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=ae39d2783db4ecadd69a7e85d92ebe45c626bd62.camel@redhat.com \
    --to=pstanner@redhat.com \
    --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=horms@kernel.org \
    --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=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).