From: Takashi Iwai Date: Fri, 7 Dec 2012 06:52:28 +0000 (+0100) Subject: ALSA: DocBook: Remove the description of __dev* X-Git-Url: http://git.mmlx.us/?a=commitdiff_plain;h=090015aeefb1360dfa2c467310530052a2965eac;p=linux-edison.git ALSA: DocBook: Remove the description of __dev* Remove obsoleted __devinit* and __devexit* from the example codes and the descriptions, or modified the descriptions a bit to match with the current situation. Signed-off-by: Takashi Iwai --- diff --git a/Documentation/DocBook/writing-an-alsa-driver.tmpl b/Documentation/DocBook/writing-an-alsa-driver.tmpl index cab4ec58e46..fb32aead5a0 100644 --- a/Documentation/DocBook/writing-an-alsa-driver.tmpl +++ b/Documentation/DocBook/writing-an-alsa-driver.tmpl @@ -433,9 +433,9 @@ /* chip-specific constructor * (see "Management of Cards and Components") */ - static int __devinit snd_mychip_create(struct snd_card *card, - struct pci_dev *pci, - struct mychip **rchip) + static int snd_mychip_create(struct snd_card *card, + struct pci_dev *pci, + struct mychip **rchip) { struct mychip *chip; int err; @@ -475,8 +475,8 @@ } /* constructor -- see "Constructor" sub-section */ - static int __devinit snd_mychip_probe(struct pci_dev *pci, - const struct pci_device_id *pci_id) + static int snd_mychip_probe(struct pci_dev *pci, + const struct pci_device_id *pci_id) { static int dev; struct snd_card *card; @@ -526,7 +526,7 @@ } /* destructor -- see the "Destructor" sub-section */ - static void __devexit snd_mychip_remove(struct pci_dev *pci) + static void snd_mychip_remove(struct pci_dev *pci) { snd_card_free(pci_get_drvdata(pci)); pci_set_drvdata(pci, NULL); @@ -542,9 +542,8 @@ The real constructor of PCI drivers is the probe callback. The probe callback and other component-constructors which are called - from the probe callback should be defined with - the __devinit prefix. You - cannot use the __init prefix for them, + from the probe callback cannot be used with + the __init prefix because any PCI device could be a hotplug device. @@ -728,7 +727,7 @@ - As further notes, the destructors (both - snd_mychip_dev_free and - snd_mychip_free) cannot be defined with - the __devexit prefix, because they may be - called from the constructor, too, at the false path. - - - For a device which allows hotplugging, you can use snd_card_free_when_closed. This one will postpone the destruction until all devices are closed. @@ -1120,9 +1111,9 @@ } /* chip-specific constructor */ - static int __devinit snd_mychip_create(struct snd_card *card, - struct pci_dev *pci, - struct mychip **rchip) + static int snd_mychip_create(struct snd_card *card, + struct pci_dev *pci, + struct mychip **rchip) { struct mychip *chip; int err; @@ -1200,7 +1191,7 @@ .name = KBUILD_MODNAME, .id_table = snd_mychip_ids, .probe = snd_mychip_probe, - .remove = __devexit_p(snd_mychip_remove), + .remove = snd_mychip_remove, }; /* module initialization */ @@ -1465,11 +1456,6 @@ - Again, remember that you cannot - use the __devexit prefix for this destructor. - - - We didn't implement the hardware disabling part in the above. If you need to do this, please note that the destructor may be called even before the initialization of the chip is completed. @@ -1619,7 +1605,7 @@ .name = KBUILD_MODNAME, .id_table = snd_mychip_ids, .probe = snd_mychip_probe, - .remove = __devexit_p(snd_mychip_remove), + .remove = snd_mychip_remove, }; ]]> @@ -1630,11 +1616,7 @@ The probe and remove functions have already been defined in the previous sections. - The remove function should - be defined with the - __devexit_p() macro, so that it's not - defined for built-in (and non-hot-pluggable) case. The - name + The name field is the name string of this device. Note that you must not use a slash / in this string. @@ -1665,9 +1647,7 @@ Note that these module entries are tagged with __init and - __exit prefixes, not - __devinit nor - __devexit. + __exit prefixes. @@ -1918,7 +1898,7 @@ */ /* create a pcm device */ - static int __devinit snd_mychip_new_pcm(struct mychip *chip) + static int snd_mychip_new_pcm(struct mychip *chip) { struct snd_pcm *pcm; int err; @@ -1957,7 +1937,7 @@ Definition of a Control - Most likely the control is created via - snd_ctl_new1(), and in such a case, you can - add the __devinitdata prefix to the - definition as above. - - - The iface field specifies the control type, SNDRV_CTL_ELEM_IFACE_XXX, which is usually MIXER. @@ -3847,10 +3820,8 @@ struct _snd_pcm_runtime { snd_ctl_new1() allocates a new - snd_kcontrol instance (that's why the definition - of my_control can be with - the __devinitdata - prefix), and snd_ctl_add assigns the given + snd_kcontrol instance, + and snd_ctl_add assigns the given control component to the card. @@ -3896,7 +3867,7 @@ struct _snd_pcm_runtime {