Re: [PATCH] PCIE: create sysfs directory on first use
From: Valdis . Kletnieks
Date: Fri Jul 07 2006 - 20:06:54 EST
On Fri, 07 Jul 2006 16:52:38 PDT, "Randy.Dunlap" said:
> @@ -405,11 +410,15 @@ void pcie_port_device_remove(struct pci_
> void pcie_port_bus_register(void)
> {
> bus_register(&pcie_port_bus_type);
> + pcie_dev_registered = 1;
Shouldn't this be 'pcie_dev_registered++;'
> }
>
> void pcie_port_bus_unregister(void)
> {
> - bus_unregister(&pcie_port_bus_type);
> + if (pcie_dev_registered) {
> + bus_unregister(&pcie_port_bus_type);
> + pcie_dev_registered = 0;
and 'pciedev_registered--;'
> + }
> }
to keep it from blowing up if 2 bus get registered, then one de-registered,
and then re-registered again? I could see this happening in a hotplug design?
Attachment:
pgp00000.pgp
Description: PGP signature