aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/maps
diff options
context:
space:
mode:
authorAlan Cox <alan@lxorguk.ukuu.org.uk>2006-10-20 17:41:06 -0400
committerDavid Woodhouse <dwmw2@infradead.org>2006-10-21 11:22:58 -0400
commitc7438d02b384e82261e28fc280167f4e7a65e822 (patch)
tree771d65271ab134500d3a9a54ab4c435b71002c40 /drivers/mtd/maps
parentf33686b5a79674bec0e1aa553d420485e3a12899 (diff)
[MTD] MAPS: esb2rom: use hotplug safe interfaces
Fairly self explanatory. Keep a reference initially, drop it when we free up the driver resources. Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'drivers/mtd/maps')
-rw-r--r--drivers/mtd/maps/esb2rom.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/mtd/maps/esb2rom.c b/drivers/mtd/maps/esb2rom.c
index e1c781482bf..a9d808a617c 100644
--- a/drivers/mtd/maps/esb2rom.c
+++ b/drivers/mtd/maps/esb2rom.c
@@ -140,8 +140,8 @@ static void esb2rom_cleanup(struct esb2rom_window *window)
140 window->virt = NULL; 140 window->virt = NULL;
141 window->phys = 0; 141 window->phys = 0;
142 window->size = 0; 142 window->size = 0;
143 window->pdev = NULL;
144 } 143 }
144 pci_dev_put(window->pdev);
145} 145}
146 146
147static int __devinit esb2rom_init_one(struct pci_dev *pdev, 147static int __devinit esb2rom_init_one(struct pci_dev *pdev,
@@ -164,7 +164,7 @@ static int __devinit esb2rom_init_one(struct pci_dev *pdev,
164 * Also you can page firmware hubs if an 8MiB window isn't enough 164 * Also you can page firmware hubs if an 8MiB window isn't enough
165 * but don't currently handle that case either. 165 * but don't currently handle that case either.
166 */ 166 */
167 window->pdev = pdev; 167 window->pdev = pci_dev_get(pdev);
168 168
169 /* RLG: experiment 2. Force the window registers to the widest values */ 169 /* RLG: experiment 2. Force the window registers to the widest values */
170 170
@@ -418,7 +418,7 @@ static int __init init_esb2rom(void)
418 pdev = NULL; 418 pdev = NULL;
419 for (id = esb2rom_pci_tbl; id->vendor; id++) { 419 for (id = esb2rom_pci_tbl; id->vendor; id++) {
420 printk(KERN_DEBUG "device id = %x\n", id->device); 420 printk(KERN_DEBUG "device id = %x\n", id->device);
421 pdev = pci_find_device(id->vendor, id->device, NULL); 421 pdev = pci_get_device(id->vendor, id->device, NULL);
422 if (pdev) { 422 if (pdev) {
423 printk(KERN_DEBUG "matched device = %x\n", id->device); 423 printk(KERN_DEBUG "matched device = %x\n", id->device);
424 break; 424 break;
@@ -427,6 +427,7 @@ static int __init init_esb2rom(void)
427 if (pdev) { 427 if (pdev) {
428 printk(KERN_DEBUG "matched device id %x\n", id->device); 428 printk(KERN_DEBUG "matched device id %x\n", id->device);
429 retVal = esb2rom_init_one(pdev, &esb2rom_pci_tbl[0]); 429 retVal = esb2rom_init_one(pdev, &esb2rom_pci_tbl[0]);
430 pci_dev_put(pdev);
430 printk(KERN_DEBUG "retVal = %d\n", retVal); 431 printk(KERN_DEBUG "retVal = %d\n", retVal);
431 return retVal; 432 return retVal;
432 } 433 }