From: Domen Puncer <domen@coderock.org>
To: kernel-janitors@vger.kernel.org
Subject: [KJ] Re: pci_find_device() in drivers/media/radio/
Date: Fri, 18 Feb 2005 23:05:21 +0000 [thread overview]
Message-ID: <20050218230521.GA3852@masina.coderock.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 2040 bytes --]
Sorry for late reply.
On 02/02/05 17:22 +0100, Christophe Lucas wrote:
> Hi,
>
> Description:
> >From : http://kerneljanitors.org/TODO
> >- delete all pci_find_* functions from the kernel tree.
> > Instead of pci_find_device use pci_get_device()..
> >- convert from pci_module_init to pci_register_driver
Patch per concept would be nice.
> diff -urpN -X /work/users/dontdiff linux-2.6.11-rc2-vanilla/drivers/media/radio/radio-maestro.c linux-2.6.11-rc2/drivers/media/radio/radio-maestro.c
> --- linux-2.6.11-rc2-vanilla/drivers/media/radio/radio-maestro.c 2005-01-26 08:31:14.000000000 +0100
> +++ linux-2.6.11-rc2/drivers/media/radio/radio-maestro.c 2005-02-02 15:43:24.000000000 +0100
> @@ -265,11 +265,11 @@ static int __init maestro_radio_init(voi
> {
> register __u16 found=0;
> struct pci_dev *pcidev = NULL;
> - while(!found && (pcidev = pci_find_device(PCI_VENDOR_ESS,
> + while(!found && (pcidev = pci_get_device(PCI_VENDOR_ESS,
you could loose trailing whitespace ^
> PCI_DEVICE_ID_ESS_ESS1968,
> pcidev)))
> found |= radio_install(pcidev);
> - while(!found && (pcidev = pci_find_device(PCI_VENDOR_ESS,
> + while(!found && (pcidev = pci_get_device(PCI_VENDOR_ESS,
> PCI_DEVICE_ID_ESS_ESS1978,
> pcidev)))
> found |= radio_install(pcidev);
> @@ -316,6 +316,7 @@ static __u16 radio_install(struct pci_de
> if(radio_power_on(&radio_unit)) {
> if(video_register_device(&maestro_radio, VFL_TYPE_RADIO, radio_nr)==-1) {
> printk("radio-maestro: can't register device!");
> + pci_dev_put(pcidev);
> return 0;
> }
> printk(KERN_INFO "radio-maestro: version "
> @@ -326,7 +327,9 @@ static __u16 radio_install(struct pci_de
> "\n");
> printk(KERN_INFO "radio-maestro: radio chip initialized\n");
> return 1;
> - } else
> + } else {
> + pci_dev_put(pcidev);
ditto.
> return 0;
> + }
> }
Whitespace is nitpicking. :-)
About pci_dev_put... it should probably also be in _exit paths, so module
can be reinserted?
Comments?
Domen
[-- Attachment #2: Type: text/plain, Size: 167 bytes --]
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors
next reply other threads:[~2005-02-18 23:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-02-18 23:05 Domen Puncer [this message]
2005-02-19 10:30 ` [KJ] Re: pci_find_device() in drivers/media/radio/ Christophe Lucas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050218230521.GA3852@masina.coderock.org \
--to=domen@coderock.org \
--cc=kernel-janitors@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.