aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging
diff options
context:
space:
mode:
authorAlan Cox <alan@linux.intel.com>2011-07-12 12:40:03 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2011-07-18 16:22:53 -0400
commit9e158e3082f9c41da75efe7dd32f6c1cf55b5e72 (patch)
tree5df1dc164ab570ae0e55582ec8bcfa3bf52651d5 /drivers/staging
parent19a3833fd4909c2d88683c0798fe039a69723194 (diff)
spectra: enable device before poking it
Otherwise if it is off at boot time things don't go to plan. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/spectra/lld_nand.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/staging/spectra/lld_nand.c b/drivers/staging/spectra/lld_nand.c
index 0be7adc96b8c..60a14ff26c7f 100644
--- a/drivers/staging/spectra/lld_nand.c
+++ b/drivers/staging/spectra/lld_nand.c
@@ -2397,6 +2397,12 @@ static int nand_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
2397 struct mrst_nand_info *pndev = &info; 2397 struct mrst_nand_info *pndev = &info;
2398 u32 int_mask; 2398 u32 int_mask;
2399 2399
2400 ret = pci_enable_device(dev);
2401 if (ret) {
2402 printk(KERN_ERR "Spectra: pci_enable_device failed.\n");
2403 return ret;
2404 }
2405
2400 nand_dbg_print(NAND_DBG_WARN, "%s, Line %d, Function: %s\n", 2406 nand_dbg_print(NAND_DBG_WARN, "%s, Line %d, Function: %s\n",
2401 __FILE__, __LINE__, __func__); 2407 __FILE__, __LINE__, __func__);
2402 2408
@@ -2404,7 +2410,7 @@ static int nand_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
2404 GLOB_HWCTL_REG_SIZE); 2410 GLOB_HWCTL_REG_SIZE);
2405 if (!FlashReg) { 2411 if (!FlashReg) {
2406 printk(KERN_ERR "Spectra: ioremap_nocache failed!"); 2412 printk(KERN_ERR "Spectra: ioremap_nocache failed!");
2407 return -ENOMEM; 2413 goto failed_disable;
2408 } 2414 }
2409 nand_dbg_print(NAND_DBG_WARN, 2415 nand_dbg_print(NAND_DBG_WARN,
2410 "Spectra: Remapped reg base address: " 2416 "Spectra: Remapped reg base address: "
@@ -2416,7 +2422,7 @@ static int nand_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
2416 if (!FlashMem) { 2422 if (!FlashMem) {
2417 printk(KERN_ERR "Spectra: ioremap_nocache failed!"); 2423 printk(KERN_ERR "Spectra: ioremap_nocache failed!");
2418 iounmap(FlashReg); 2424 iounmap(FlashReg);
2419 return -ENOMEM; 2425 goto failed_disable;
2420 } 2426 }
2421 nand_dbg_print(NAND_DBG_WARN, 2427 nand_dbg_print(NAND_DBG_WARN,
2422 "Spectra: Remapped flash base address: " 2428 "Spectra: Remapped flash base address: "
@@ -2479,11 +2485,6 @@ static int nand_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
2479 iowrite32(0, FlashReg + TWO_ROW_ADDR_CYCLES); 2485 iowrite32(0, FlashReg + TWO_ROW_ADDR_CYCLES);
2480 iowrite32(1, FlashReg + ECC_ENABLE); 2486 iowrite32(1, FlashReg + ECC_ENABLE);
2481 enable_ecc = 1; 2487 enable_ecc = 1;
2482 ret = pci_enable_device(dev);
2483 if (ret) {
2484 printk(KERN_ERR "Spectra: pci_enable_device failed.\n");
2485 goto failed_req_csr;
2486 }
2487 2488
2488 pci_set_master(dev); 2489 pci_set_master(dev);
2489 pndev->dev = dev; 2490 pndev->dev = dev;
@@ -2558,9 +2559,10 @@ static int nand_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
2558failed_remap_csr: 2559failed_remap_csr:
2559 pci_release_regions(dev); 2560 pci_release_regions(dev);
2560failed_req_csr: 2561failed_req_csr:
2561 pci_disable_device(dev);
2562 iounmap(FlashMem); 2562 iounmap(FlashMem);
2563 iounmap(FlashReg); 2563 iounmap(FlashReg);
2564failed_disable:
2565 pci_disable_device(dev);
2564 2566
2565 return ret; 2567 return ret;
2566} 2568}