Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 252540
b: refs/heads/master
c: 46720bb
h: refs/heads/master
v: v3
  • Loading branch information
Jamie Iles authored and David Woodhouse committed May 25, 2011
1 parent 6262922 commit 8809d7a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 88146872f0fbd89e425e3e0db71d42df8db9d932
refs/heads/master: 46720bbf67224660271a04a7ab03913fd0d3c206
11 changes: 2 additions & 9 deletions trunk/drivers/mtd/nand/cafe_nand.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,7 @@ static unsigned int numtimings;
static int timing[3];
module_param_array(timing, int, &numtimings, 0644);

#ifdef CONFIG_MTD_PARTITIONS
static const char *part_probes[] = { "cmdlinepart", "RedBoot", NULL };
#endif

/* Hrm. Why isn't this already conditional on something in the struct device? */
#define cafe_dev_dbg(dev, args...) do { if (debug) dev_dbg(dev, ##args); } while(0)
Expand Down Expand Up @@ -632,10 +630,8 @@ static int __devinit cafe_nand_probe(struct pci_dev *pdev,
struct cafe_priv *cafe;
uint32_t ctrl;
int err = 0;
#ifdef CONFIG_MTD_PARTITIONS
struct mtd_partition *parts;
int nr_parts;
#endif

/* Very old versions shared the same PCI ident for all three
functions on the chip. Verify the class too... */
Expand Down Expand Up @@ -804,19 +800,17 @@ static int __devinit cafe_nand_probe(struct pci_dev *pdev,
pci_set_drvdata(pdev, mtd);

/* We register the whole device first, separate from the partitions */
add_mtd_device(mtd);
mtd_device_register(mtd, NULL, 0);

#ifdef CONFIG_MTD_PARTITIONS
#ifdef CONFIG_MTD_CMDLINE_PARTS
mtd->name = "cafe_nand";
#endif
nr_parts = parse_mtd_partitions(mtd, part_probes, &parts, 0);
if (nr_parts > 0) {
cafe->parts = parts;
dev_info(&cafe->pdev->dev, "%d partitions found\n", nr_parts);
add_mtd_partitions(mtd, parts, nr_parts);
mtd_device_register(mtd, parts, nr_parts);
}
#endif
goto out;

out_irq:
Expand All @@ -838,7 +832,6 @@ static void __devexit cafe_nand_remove(struct pci_dev *pdev)
struct mtd_info *mtd = pci_get_drvdata(pdev);
struct cafe_priv *cafe = mtd->priv;

del_mtd_device(mtd);
/* Disable NAND IRQ in global IRQ mask register */
cafe_writel(cafe, ~1 & cafe_readl(cafe, GLOBAL_IRQ_MASK), GLOBAL_IRQ_MASK);
free_irq(pdev->irq, mtd);
Expand Down

0 comments on commit 8809d7a

Please sign in to comment.