* [PATCH 0/2] PCI: Remove no_pci_devices
@ 2026-04-02 22:15 Heiner Kallweit
2026-04-02 22:17 ` [PATCH 1/2] input: pc110pad: change PCI check to get rid of orphaned no_pci_devices Heiner Kallweit
2026-04-02 22:18 ` [PATCH 2/2] PCI: Remove no_pci_devices Heiner Kallweit
0 siblings, 2 replies; 5+ messages in thread
From: Heiner Kallweit @ 2026-04-02 22:15 UTC (permalink / raw)
To: Dmitry Torokhov, Bjorn Helgaas
Cc: open list:HID CORE LAYER, linux-pci@vger.kernel.org
Remove the last user of no_pci_devices(), and then the function itself.
Heiner Kallweit (2):
input: pc110pad: change PCI check to get rid of orphaned
no_pci_devices
PCI: Remove no_pci_devices
drivers/input/mouse/pc110pad.c | 2 +-
drivers/pci/probe.c | 17 -----------------
include/linux/pci.h | 3 ---
3 files changed, 1 insertion(+), 21 deletions(-)
--
2.53.0
^ permalink raw reply [flat|nested] 5+ messages in thread* [PATCH 1/2] input: pc110pad: change PCI check to get rid of orphaned no_pci_devices 2026-04-02 22:15 [PATCH 0/2] PCI: Remove no_pci_devices Heiner Kallweit @ 2026-04-02 22:17 ` Heiner Kallweit 2026-04-06 17:23 ` Bjorn Helgaas 2026-04-02 22:18 ` [PATCH 2/2] PCI: Remove no_pci_devices Heiner Kallweit 1 sibling, 1 reply; 5+ messages in thread From: Heiner Kallweit @ 2026-04-02 22:17 UTC (permalink / raw) To: Dmitry Torokhov, Bjorn Helgaas Cc: open list:HID CORE LAYER, linux-pci@vger.kernel.org As a prerequisite for removing no_pci_devices(), replace its usage here with an equivalent check for presence of a PCI bus. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> --- drivers/input/mouse/pc110pad.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/mouse/pc110pad.c b/drivers/input/mouse/pc110pad.c index efa58049f..c7a6df210 100644 --- a/drivers/input/mouse/pc110pad.c +++ b/drivers/input/mouse/pc110pad.c @@ -91,7 +91,7 @@ static int __init pc110pad_init(void) { int err; - if (!no_pci_devices()) + if (pci_find_next_bus(NULL)) return -ENODEV; if (!request_region(pc110pad_io, 4, "pc110pad")) { -- 2.53.0 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] input: pc110pad: change PCI check to get rid of orphaned no_pci_devices 2026-04-02 22:17 ` [PATCH 1/2] input: pc110pad: change PCI check to get rid of orphaned no_pci_devices Heiner Kallweit @ 2026-04-06 17:23 ` Bjorn Helgaas 2026-04-06 19:02 ` Dmitry Torokhov 0 siblings, 1 reply; 5+ messages in thread From: Bjorn Helgaas @ 2026-04-06 17:23 UTC (permalink / raw) To: Heiner Kallweit Cc: Dmitry Torokhov, Bjorn Helgaas, open list:HID CORE LAYER, linux-pci@vger.kernel.org On Fri, Apr 03, 2026 at 12:17:35AM +0200, Heiner Kallweit wrote: > As a prerequisite for removing no_pci_devices(), replace its usage here > with an equivalent check for presence of a PCI bus. > > Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> > --- > drivers/input/mouse/pc110pad.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/input/mouse/pc110pad.c b/drivers/input/mouse/pc110pad.c > index efa58049f..c7a6df210 100644 > --- a/drivers/input/mouse/pc110pad.c > +++ b/drivers/input/mouse/pc110pad.c > @@ -91,7 +91,7 @@ static int __init pc110pad_init(void) > { > int err; > > - if (!no_pci_devices()) > + if (pci_find_next_bus(NULL)) > return -ENODEV; I'd certainly love to get rid of no_pci_devices(), although using pci_find_next_bus() is not really much better. I don't have much opinion about pc110pad.c change. It's essentially still the same kludge, which has been there at least since the beginning of git history. Dmitry, if you want to ack this, I can take both together. Bjorn ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] input: pc110pad: change PCI check to get rid of orphaned no_pci_devices 2026-04-06 17:23 ` Bjorn Helgaas @ 2026-04-06 19:02 ` Dmitry Torokhov 0 siblings, 0 replies; 5+ messages in thread From: Dmitry Torokhov @ 2026-04-06 19:02 UTC (permalink / raw) To: Bjorn Helgaas Cc: Heiner Kallweit, Bjorn Helgaas, open list:HID CORE LAYER, linux-pci@vger.kernel.org On Mon, Apr 06, 2026 at 12:23:24PM -0500, Bjorn Helgaas wrote: > On Fri, Apr 03, 2026 at 12:17:35AM +0200, Heiner Kallweit wrote: > > As a prerequisite for removing no_pci_devices(), replace its usage here > > with an equivalent check for presence of a PCI bus. > > > > Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> > > --- > > drivers/input/mouse/pc110pad.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/input/mouse/pc110pad.c b/drivers/input/mouse/pc110pad.c > > index efa58049f..c7a6df210 100644 > > --- a/drivers/input/mouse/pc110pad.c > > +++ b/drivers/input/mouse/pc110pad.c > > @@ -91,7 +91,7 @@ static int __init pc110pad_init(void) > > { > > int err; > > > > - if (!no_pci_devices()) > > + if (pci_find_next_bus(NULL)) > > return -ENODEV; > > I'd certainly love to get rid of no_pci_devices(), although using > pci_find_next_bus() is not really much better. > > I don't have much opinion about pc110pad.c change. It's essentially > still the same kludge, which has been there at least since the > beginning of git history. > > Dmitry, if you want to ack this, I can take both together. Given "x86/cpu: Remove M486/M486SX/ELAN support" I'd just drop the driver completely. I tried it in 2024 but Maciej was insistent that keeping these old drivers doe snot hurt. Now I think we can get rid of them. You can grab the patch removing it from https://lore.kernel.org/all/20240808172733.1194442-4-dmitry.torokhov@gmail.com/ as I think it should still apply. Thanks. -- Dmitry ^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 2/2] PCI: Remove no_pci_devices 2026-04-02 22:15 [PATCH 0/2] PCI: Remove no_pci_devices Heiner Kallweit 2026-04-02 22:17 ` [PATCH 1/2] input: pc110pad: change PCI check to get rid of orphaned no_pci_devices Heiner Kallweit @ 2026-04-02 22:18 ` Heiner Kallweit 1 sibling, 0 replies; 5+ messages in thread From: Heiner Kallweit @ 2026-04-02 22:18 UTC (permalink / raw) To: Dmitry Torokhov, Bjorn Helgaas Cc: open list:HID CORE LAYER, linux-pci@vger.kernel.org After having removed the last usage of no_pci_devices(), this function can be removed. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> --- drivers/pci/probe.c | 17 ----------------- include/linux/pci.h | 3 --- 2 files changed, 20 deletions(-) diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index bccc7a4bd..19d73f613 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -67,23 +67,6 @@ static struct resource *get_pci_domain_busn_res(int domain_nr) return &r->res; } -/* - * Some device drivers need know if PCI is initiated. - * Basically, we think PCI is not initiated when there - * is no device to be found on the pci_bus_type. - */ -int no_pci_devices(void) -{ - struct device *dev; - int no_devices; - - dev = bus_find_next_device(&pci_bus_type, NULL); - no_devices = (dev == NULL); - put_device(dev); - return no_devices; -} -EXPORT_SYMBOL(no_pci_devices); - /* * PCI Bus Class */ diff --git a/include/linux/pci.h b/include/linux/pci.h index 8861eeb43..cc98713e3 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -1201,8 +1201,6 @@ extern const struct bus_type pci_bus_type; /* Do NOT directly access these two variables, unless you are arch-specific PCI * code, or PCI core code. */ extern struct list_head pci_root_buses; /* List of all known PCI buses */ -/* Some device drivers need know if PCI is initiated */ -int no_pci_devices(void); void pcibios_resource_survey_bus(struct pci_bus *bus); void pcibios_bus_add_device(struct pci_dev *pdev); @@ -2140,7 +2138,6 @@ static inline struct pci_dev *pci_get_base_class(unsigned int class, static inline int pci_dev_present(const struct pci_device_id *ids) { return 0; } -#define no_pci_devices() (1) #define pci_dev_put(dev) do { } while (0) static inline void pci_set_master(struct pci_dev *dev) { } -- 2.53.0 ^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-04-06 19:02 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-04-02 22:15 [PATCH 0/2] PCI: Remove no_pci_devices Heiner Kallweit 2026-04-02 22:17 ` [PATCH 1/2] input: pc110pad: change PCI check to get rid of orphaned no_pci_devices Heiner Kallweit 2026-04-06 17:23 ` Bjorn Helgaas 2026-04-06 19:02 ` Dmitry Torokhov 2026-04-02 22:18 ` [PATCH 2/2] PCI: Remove no_pci_devices Heiner Kallweit
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox