From: "Daniel Marjamäki" <daniel.marjamaki@comhem.se>
To: kernel-janitors@vger.kernel.org
Subject: [KJ] changed from pci_find_device to pci_get_device
Date: Sun, 27 Nov 2005 19:41:20 +0000 [thread overview]
Message-ID: <438A0BE0.4010904@comhem.se> (raw)
Hello friends!
I've made some changes and are interested in feedback (drivers/ide/pci/via82cxxx.c).
Some notes:
* The main change was to switch from pci_find_device to pci_get_device.
* I unlock "isa" when it won't be used anymore
* Changed a return value because init_chipset_via82cxxx returns an unsigned value.
This is the patch in a readable format:
static unsigned int __devinit init_chipset_via82cxxx(struct pci_dev *dev, const char *name)
{
struct pci_dev *isa = NULL;
for (via_config = via_isa_bridges; via_config->id; via_config++)
- if ((isa = pci_find_device(PCI_VENDOR_ID_VIA +
+ if ((isa = pci_get_device(PCI_VENDOR_ID_VIA +
!!(via_config->flags & VIA_BAD_ID),
via_config->id, NULL))) {
pci_read_config_byte(isa, PCI_REVISION_ID, &t);
if (t >= via_config->rev_min &&
t <= via_config->rev_max)
break;
+
+ pci_dev_put(isa);
}
if (!via_config->id) {
printk(KERN_WARNING "VP_IDE: Unknown VIA SouthBridge, disabling DMA.\n");
- return -ENODEV;
+ return ENODEV;
}
/* DO STUFF (I don't include it here for your convenience) */
#if defined(DISPLAY_VIA_TIMINGS) && defined(CONFIG_PROC_FS)
- if (!via_proc) {
+ if (via_proc) {
+ isa_dev = NULL;
+ pci_dev_put(isa);
+ } else {
via_base = pci_resource_start(dev, 4);
bmide_dev = dev;
isa_dev = isa;
ide_pci_create_host_proc("via", via_get_info);
via_proc = 1;
}
+#else
+ pci_dev_put(isa);
#endif /* DISPLAY_VIA_TIMINGS && CONFIG_PROC_FS */
return 0;
}
+#if defined(DISPLAY_VIA_TIMINGS) && defined(CONFIG_PROC_FS)
+static void via_ide_exit(void)
+{
+ if (isa_dev)
+ pci_dev_put(isa_dev);
+}
+module_exit(via_ide_exit);
+#endif /* DISPLAY_VIA_TIMINGS && CONFIG_PROC_FS */
Best regards,
Daniel Marjamäki
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors
next reply other threads:[~2005-11-27 19:41 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-27 19:41 Daniel Marjamäki [this message]
2005-11-28 20:53 ` [KJ] changed from pci_find_device to pci_get_device Greg KH
2005-11-28 21:43 ` Daniel Marjamäki
2005-11-29 11:44 ` Alexey Dobriyan
2005-11-29 11:51 ` Daniel Marjamäki
2005-11-29 12:58 ` Alexey Dobriyan
2005-11-29 13:20 ` Daniel Marjamäki
2005-11-29 13:56 ` Daniel Marjamäki
2005-11-29 17:34 ` Greg KH
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=438A0BE0.4010904@comhem.se \
--to=daniel.marjamaki@comhem.se \
--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.