* [PATCH] x86/platform/intel-mid: Replace deprecated PCI functions
@ 2024-11-05 11:25 Philipp Stanner
2024-11-05 14:52 ` Andy Shevchenko
0 siblings, 1 reply; 4+ messages in thread
From: Philipp Stanner @ 2024-11-05 11:25 UTC (permalink / raw)
To: Andy Shevchenko, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
Dave Hansen, x86, H. Peter Anvin
Cc: linux-kernel, Philipp Stanner
pcim_iomap_table() and pcim_request_regions() have been deprecated in
commit e354bb84a4c1 ("PCI: Deprecate pcim_iomap_table(),
pcim_iomap_regions_request_all()") and commit d140f80f60358 ("PCI:
Deprecate pcim_iomap_regions() in favor of pcim_iomap_region()"),
respectively.
Replace these functions with pcim_iomap_region().
Additionally, pass the actual driver name to pcim_iomap_region()
instead of the previous pci_name(), since the 'name' parameter should
always reflect which driver owns a region.
Signed-off-by: Philipp Stanner <pstanner@redhat.com>
---
arch/x86/platform/intel-mid/pwr.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/arch/x86/platform/intel-mid/pwr.c b/arch/x86/platform/intel-mid/pwr.c
index 27288d8d3f71..96fe7bf60ca0 100644
--- a/arch/x86/platform/intel-mid/pwr.c
+++ b/arch/x86/platform/intel-mid/pwr.c
@@ -358,18 +358,15 @@ static int mid_pwr_probe(struct pci_dev *pdev, const struct pci_device_id *id)
return ret;
}
- ret = pcim_iomap_regions(pdev, 1 << 0, pci_name(pdev));
- if (ret) {
- dev_err(&pdev->dev, "I/O memory remapping failed\n");
- return ret;
- }
-
pwr = devm_kzalloc(dev, sizeof(*pwr), GFP_KERNEL);
if (!pwr)
return -ENOMEM;
+ pwr->regs = pcim_iomap_region(pdev, 0, "intel_mid_pwr");
+ if (IS_ERR(pwr->regs))
+ return PTR_ERR(pwr->regs);
+
pwr->dev = dev;
- pwr->regs = pcim_iomap_table(pdev)[0];
pwr->irq = pdev->irq;
mutex_init(&pwr->lock);
--
2.47.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] x86/platform/intel-mid: Replace deprecated PCI functions
2024-11-05 11:25 [PATCH] x86/platform/intel-mid: Replace deprecated PCI functions Philipp Stanner
@ 2024-11-05 14:52 ` Andy Shevchenko
2024-11-06 8:37 ` Philipp Stanner
0 siblings, 1 reply; 4+ messages in thread
From: Andy Shevchenko @ 2024-11-05 14:52 UTC (permalink / raw)
To: Philipp Stanner
Cc: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86,
H. Peter Anvin, linux-kernel
On Tue, Nov 05, 2024 at 12:25:22PM +0100, Philipp Stanner wrote:
> pcim_iomap_table() and pcim_request_regions() have been deprecated in
> commit e354bb84a4c1 ("PCI: Deprecate pcim_iomap_table(),
> pcim_iomap_regions_request_all()") and commit d140f80f60358 ("PCI:
> Deprecate pcim_iomap_regions() in favor of pcim_iomap_region()"),
> respectively.
>
> Replace these functions with pcim_iomap_region().
>
> Additionally, pass the actual driver name to pcim_iomap_region()
> instead of the previous pci_name(), since the 'name' parameter should
> always reflect which driver owns a region.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
...
> - ret = pcim_iomap_regions(pdev, 1 << 0, pci_name(pdev));
> - if (ret) {
> - dev_err(&pdev->dev, "I/O memory remapping failed\n");
Btw, do we have a similar message to be printed inside the new call?
> - return ret;
> - }
...
> + pwr->regs = pcim_iomap_region(pdev, 0, "intel_mid_pwr");
> + if (IS_ERR(pwr->regs))
> + return PTR_ERR(pwr->regs);
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] x86/platform/intel-mid: Replace deprecated PCI functions
2024-11-05 14:52 ` Andy Shevchenko
@ 2024-11-06 8:37 ` Philipp Stanner
2024-11-06 11:05 ` Andy Shevchenko
0 siblings, 1 reply; 4+ messages in thread
From: Philipp Stanner @ 2024-11-06 8:37 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86,
H. Peter Anvin, linux-kernel
On Tue, 2024-11-05 at 16:52 +0200, Andy Shevchenko wrote:
> On Tue, Nov 05, 2024 at 12:25:22PM +0100, Philipp Stanner wrote:
> > pcim_iomap_table() and pcim_request_regions() have been deprecated
> > in
> > commit e354bb84a4c1 ("PCI: Deprecate pcim_iomap_table(),
> > pcim_iomap_regions_request_all()") and commit d140f80f60358 ("PCI:
> > Deprecate pcim_iomap_regions() in favor of pcim_iomap_region()"),
> > respectively.
> >
> > Replace these functions with pcim_iomap_region().
> >
> > Additionally, pass the actual driver name to pcim_iomap_region()
> > instead of the previous pci_name(), since the 'name' parameter
> > should
> > always reflect which driver owns a region.
>
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
>
> ...
>
> > - ret = pcim_iomap_regions(pdev, 1 << 0, pci_name(pdev));
> > - if (ret) {
> > - dev_err(&pdev->dev, "I/O memory remapping
> > failed\n");
>
> Btw, do we have a similar message to be printed inside the new call?
Hm, no, it seems I forgot. Normally I keep those messages.
In this particular case we probably want to say "I/O memory request /
remapping failed\n", though.
And/or we give back the error code, which would reveal the exact issue
through -ENOMEM / -EBUSY
P.
>
> > - return ret;
> > - }
>
> ...
>
> > + pwr->regs = pcim_iomap_region(pdev, 0, "intel_mid_pwr");
> > + if (IS_ERR(pwr->regs))
> > + return PTR_ERR(pwr->regs);
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] x86/platform/intel-mid: Replace deprecated PCI functions
2024-11-06 8:37 ` Philipp Stanner
@ 2024-11-06 11:05 ` Andy Shevchenko
0 siblings, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2024-11-06 11:05 UTC (permalink / raw)
To: Philipp Stanner
Cc: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86,
H. Peter Anvin, linux-kernel
On Wed, Nov 06, 2024 at 09:37:51AM +0100, Philipp Stanner wrote:
> On Tue, 2024-11-05 at 16:52 +0200, Andy Shevchenko wrote:
> > On Tue, Nov 05, 2024 at 12:25:22PM +0100, Philipp Stanner wrote:
...
> > > - ret = pcim_iomap_regions(pdev, 1 << 0, pci_name(pdev));
> > > - if (ret) {
> > > - dev_err(&pdev->dev, "I/O memory remapping
> > > failed\n");
> >
> > Btw, do we have a similar message to be printed inside the new call?
>
> Hm, no, it seems I forgot. Normally I keep those messages.
>
> In this particular case we probably want to say "I/O memory request /
> remapping failed\n", though.
>
> And/or we give back the error code, which would reveal the exact issue
> through -ENOMEM / -EBUSY
I would expect this to behave in a similar way to devm_*ioremap*() which prints
message(s) and returns different error codes depending on the failure.
> > > - return ret;
> > > - }
...
> > > + pwr->regs = pcim_iomap_region(pdev, 0, "intel_mid_pwr");
> > > + if (IS_ERR(pwr->regs))
> > > + return PTR_ERR(pwr->regs);
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-11-06 11:08 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-05 11:25 [PATCH] x86/platform/intel-mid: Replace deprecated PCI functions Philipp Stanner
2024-11-05 14:52 ` Andy Shevchenko
2024-11-06 8:37 ` Philipp Stanner
2024-11-06 11:05 ` Andy Shevchenko
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®