[MTD] [NAND] Fix PCI ident table for CAFÉ NAND controller.

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Sat Oct 6 15:59:01 EDT 2007


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=06ed24e5773346eb13579a4ae9599502bc78e4f7
Commit:     06ed24e5773346eb13579a4ae9599502bc78e4f7
Parent:     39fd179a7bfca026a269724a1f4ee5eb3f10419a
Author:     David Woodhouse <dwmw2 at infradead.org>
AuthorDate: Sat Oct 6 14:44:12 2007 -0400
Committer:  David Woodhouse <dwmw2 at infradead.org>
CommitDate: Sat Oct 6 14:44:12 2007 -0400

    [MTD] [NAND] Fix PCI ident table for CAFÉ NAND controller.
    
    It was only the very early prototypes which made the mistake of using
    the same device ident for all three functions on the device -- don't
    bother trying to express that in the PCI match table, since the tools
    don't cope. We can check in the probe routine instead, just in case.
    Also remember to terminate the table.
    
    Signed-off-by: David Woodhouse <dwmw2 at infradead.org>
---
 drivers/mtd/nand/cafe_nand.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/nand/cafe_nand.c b/drivers/mtd/nand/cafe_nand.c
index cff969d..0b3f840 100644
--- a/drivers/mtd/nand/cafe_nand.c
+++ b/drivers/mtd/nand/cafe_nand.c
@@ -623,6 +623,11 @@ static int __devinit cafe_nand_probe(struct pci_dev *pdev,
 	uint32_t ctrl;
 	int err = 0;
 
+	/* Very old versions shared the same PCI ident for all three
+	   functions on the chip. Verify the class too... */
+	if ((pdev->class >> 8) != PCI_CLASS_MEMORY_FLASH)
+		return -ENODEV;
+
 	err = pci_enable_device(pdev);
 	if (err)
 		return err;
@@ -816,7 +821,8 @@ static void __devexit cafe_nand_remove(struct pci_dev *pdev)
 }
 
 static struct pci_device_id cafe_nand_tbl[] = {
-	{ 0x11ab, 0x4100, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_MEMORY_FLASH << 8, 0xFFFF0 }
+	{ 0x11ab, 0x4100, PCI_ANY_ID, PCI_ANY_ID },
+	{ }
 };
 
 MODULE_DEVICE_TABLE(pci, cafe_nand_tbl);



More information about the linux-mtd-cvs mailing list