diff options
author | Alan Cox <alan@lxorguk.ukuu.org.uk> | 2006-09-22 10:19:20 +0100 |
---|---|---|
committer | David Woodhouse <dwmw2@infradead.org> | 2006-09-22 10:19:20 +0100 |
commit | dd8e9ed6ed544e2b924429d29cd2a6b55590109b (patch) | |
tree | 0961c205e59591e7da65ce7504c919e7ee3e4351 /drivers/mtd/maps/scx200_docflash.c | |
parent | 668040fcd1e06fc3e68a92708cbdfa5a52c37d3c (diff) | |
download | kernel_samsung_smdk4412-dd8e9ed6ed544e2b924429d29cd2a6b55590109b.tar.gz kernel_samsung_smdk4412-dd8e9ed6ed544e2b924429d29cd2a6b55590109b.tar.bz2 kernel_samsung_smdk4412-dd8e9ed6ed544e2b924429d29cd2a6b55590109b.zip |
[MTD] Switch to pci_get_device and do ref counting
Signed-off-by: Alan Cox <alan@redhat.com>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'drivers/mtd/maps/scx200_docflash.c')
-rw-r--r-- | drivers/mtd/maps/scx200_docflash.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/mtd/maps/scx200_docflash.c b/drivers/mtd/maps/scx200_docflash.c index 7391fd544e8..5e2bce22f37 100644 --- a/drivers/mtd/maps/scx200_docflash.c +++ b/drivers/mtd/maps/scx200_docflash.c @@ -87,19 +87,23 @@ static int __init init_scx200_docflash(void) printk(KERN_DEBUG NAME ": NatSemi SCx200 DOCCS Flash Driver\n"); - if ((bridge = pci_find_device(PCI_VENDOR_ID_NS, + if ((bridge = pci_get_device(PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_SCx200_BRIDGE, NULL)) == NULL) return -ENODEV; /* check that we have found the configuration block */ - if (!scx200_cb_present()) + if (!scx200_cb_present()) { + pci_dev_put(bridge); return -ENODEV; + } if (probe) { /* Try to use the present flash mapping if any */ pci_read_config_dword(bridge, SCx200_DOCCS_BASE, &base); pci_read_config_dword(bridge, SCx200_DOCCS_CTRL, &ctrl); + pci_dev_put(bridge); + pmr = inl(scx200_cb_base + SCx200_PMR); if (base == 0 @@ -127,6 +131,7 @@ static int __init init_scx200_docflash(void) return -ENOMEM; } } else { + pci_dev_put(bridge); for (u = size; u > 1; u >>= 1) ; if (u != 1) { |