Subject: [PATCH] Change pci_module_init from macro to inline function marked as deprecated

From: Henrik Kretzschmar <[email protected]>

Replaces the pci_module_init()-macro with a inline function,
which is marked as deprecated.
This gives a warning at compile time, which may be useful for driver developers who still use
pci_module_init() on 2.6 drivers.

Signed-of-by: Henrik Kretzschmar <[email protected]>

---

--- linux-2.6.18-rc4/include/linux/pci.h 2006-08-11 10:10:08.000000000 +0200
+++ linux/include/linux/pci.h 2006-08-11 15:04:21.000000000 +0200
@@ -384,12 +384,6 @@
.vendor = PCI_ANY_ID, .device = PCI_ANY_ID, \
.subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID

-/*
- * pci_module_init is obsolete, this stays here till we fix up all usages of it
- * in the tree.
- */
-#define pci_module_init pci_register_driver
-
/* these external functions are only available when PCI support is enabled */
#ifdef CONFIG_PCI

@@ -547,6 +541,16 @@
return __pci_register_driver(driver, THIS_MODULE);
}

+/*
+ * pci_module_init is obsolete, this stays here till we fix up all usages of it
+ * in the tree.
+ */
+
+static inline int __deprecated pci_module_init(struct pci_driver* drv)
+{
+ return pci_register_driver(drv);
+}
+
void pci_unregister_driver(struct pci_driver *);
void pci_remove_behind_bridge(struct pci_dev *);
struct pci_driver *pci_dev_driver(const struct pci_dev *);



2006-08-15 09:42:57

by Arjan van de Ven

[permalink] [raw]
Subject: Re: [PATCH] Change pci_module_init from macro to inline function marked as deprecated

On Tue, 2006-08-15 at 11:03 +0200, Henne wrote:
> From: Henrik Kretzschmar <[email protected]>
>
> Replaces the pci_module_init()-macro with a inline function,
> which is marked as deprecated.
> This gives a warning at compile time, which may be useful for driver developers who still use
> pci_module_init() on 2.6 drivers.

Hi,

good work, but please stick this also in feature-removal.txt with a
hard date on it, otherwise we can never get rid of it.....

Greetings,
Arjan van de Ven

--
if you want to mail me at work (you don't), use arjan (at) linux.intel.com

Subject: Re: [PATCH] Change pci_module_init from macro to inline function marked as deprecated

Arjan van de Ven schrieb:
> On Tue, 2006-08-15 at 11:03 +0200, Henne wrote:
>> From: Henrik Kretzschmar <[email protected]>
>>
>> Replaces the pci_module_init()-macro with a inline function,
>> which is marked as deprecated.
>> This gives a warning at compile time, which may be useful for driver developers who still use
>> pci_module_init() on 2.6 drivers.
>
> Hi,
>
> good work, but please stick this also in feature-removal.txt with a
> hard date on it, otherwise we can never get rid of it.....
>
> Greetings,
> Arjan van de Ven
>
Hi,

it's already in that file since Feb06 ;).
The removal date is Jan07.

Greets,
Henne

2006-08-15 19:38:34

by Greg KH

[permalink] [raw]
Subject: Re: [PATCH] Change pci_module_init from macro to inline function marked as deprecated

On Tue, Aug 15, 2006 at 11:03:30AM +0200, Henne wrote:
> From: Henrik Kretzschmar <[email protected]>
>
> Replaces the pci_module_init()-macro with a inline function,
> which is marked as deprecated.
> This gives a warning at compile time, which may be useful for driver developers who still use
> pci_module_init() on 2.6 drivers.

Have you gotten the network driver authors to buy into this? Last I
heard, they did not want to change over for a few reasons.

If not, I'm not going to apply this, as it will just cause a zillion
warnings that will not get fixed up.

thanks,

greg k-h