diff options
author | Alan Cox <alan@lxorguk.ukuu.org.uk> | 2006-09-22 05:19:20 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@infradead.org> | 2006-09-22 05:19:20 -0400 |
commit | dd8e9ed6ed544e2b924429d29cd2a6b55590109b (patch) | |
tree | 0961c205e59591e7da65ce7504c919e7ee3e4351 /drivers/mtd/maps/amd76xrom.c | |
parent | 668040fcd1e06fc3e68a92708cbdfa5a52c37d3c (diff) |
[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/amd76xrom.c')
-rw-r--r-- | drivers/mtd/maps/amd76xrom.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/mtd/maps/amd76xrom.c b/drivers/mtd/maps/amd76xrom.c index 447955be18af..797caffb20b1 100644 --- a/drivers/mtd/maps/amd76xrom.c +++ b/drivers/mtd/maps/amd76xrom.c | |||
@@ -57,6 +57,7 @@ static void amd76xrom_cleanup(struct amd76xrom_window *window) | |||
57 | /* Disable writes through the rom window */ | 57 | /* Disable writes through the rom window */ |
58 | pci_read_config_byte(window->pdev, 0x40, &byte); | 58 | pci_read_config_byte(window->pdev, 0x40, &byte); |
59 | pci_write_config_byte(window->pdev, 0x40, byte & ~1); | 59 | pci_write_config_byte(window->pdev, 0x40, byte & ~1); |
60 | pci_dev_put(window->pdev); | ||
60 | } | 61 | } |
61 | 62 | ||
62 | /* Free all of the mtd devices */ | 63 | /* Free all of the mtd devices */ |
@@ -91,7 +92,7 @@ static int __devinit amd76xrom_init_one (struct pci_dev *pdev, | |||
91 | struct amd76xrom_map_info *map = NULL; | 92 | struct amd76xrom_map_info *map = NULL; |
92 | unsigned long map_top; | 93 | unsigned long map_top; |
93 | 94 | ||
94 | /* Remember the pci dev I find the window in */ | 95 | /* Remember the pci dev I find the window in - already have a ref */ |
95 | window->pdev = pdev; | 96 | window->pdev = pdev; |
96 | 97 | ||
97 | /* Assume the rom window is properly setup, and find it's size */ | 98 | /* Assume the rom window is properly setup, and find it's size */ |
@@ -302,7 +303,7 @@ static int __init init_amd76xrom(void) | |||
302 | struct pci_device_id *id; | 303 | struct pci_device_id *id; |
303 | pdev = NULL; | 304 | pdev = NULL; |
304 | for(id = amd76xrom_pci_tbl; id->vendor; id++) { | 305 | for(id = amd76xrom_pci_tbl; id->vendor; id++) { |
305 | pdev = pci_find_device(id->vendor, id->device, NULL); | 306 | pdev = pci_get_device(id->vendor, id->device, NULL); |
306 | if (pdev) { | 307 | if (pdev) { |
307 | break; | 308 | break; |
308 | } | 309 | } |