Skip to contentSkip to conversation

MMC: use pci_dev->revision

PATCH In review Sergei Shtylyov 2 participants 2 messages Mar 17, 2011 – Mar 18, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 MMC: use pci_dev->revision

The SDHCI driver uses PCI_CLASS_REVISION instead of PCI_REVISION_ID, so it was not converted by commit 44c10138fd4bbc4b6d6bff0873c24902f2a9da65 (PCI: Change all drivers to use pci_device->revision). The newer VIA driver has the similar code too. So convert both drivers to using the 'revision' field of 'struct pci_dev' now...

---
The patch is against the recent Linus' tree.

 drivers/mmc/host/sdhci-pci.c |    6 ++----
 drivers/mmc/host/via-sdmmc.c |    5 ++---
 2 files changed, 4 insertions(+), 7 deletions(-)
drivers/mmc/host/sdhci-pci.c +2 -4
Index: linux-2.6/drivers/mmc/host/sdhci-pci.c
===================================================================
@@ -1012,16 +1012,14 @@ static int __devinit sdhci_pci_probe(str
 	struct sdhci_pci_chip *chip;
 	struct sdhci_pci_slot *slot;
 
-	u8 slots, rev, first_bar;
+	u8 slots, first_bar;
 	int ret, i;
 
 	BUG_ON(pdev == NULL);
 	BUG_ON(ent == NULL);
 
-	pci_read_config_byte(pdev, PCI_CLASS_REVISION, &rev);
-
 	dev_info(&pdev->dev, "SDHCI controller found [%04x:%04x] (rev %x)\n",
-		 (int)pdev->vendor, (int)pdev->device, (int)rev);
+		 (int)pdev->vendor, (int)pdev->device, (int)pdev->revision);
 
 	ret = pci_read_config_byte(pdev, PCI_SLOT_INFO, &slots);
 	if (ret)
drivers/mmc/host/via-sdmmc.c +2 -3
Index: linux-2.6/drivers/mmc/host/via-sdmmc.c
===================================================================
@@ -1090,14 +1090,13 @@ static int __devinit via_sd_probe(struct
 	struct mmc_host *mmc;
 	struct via_crdr_mmc_host *sdhost;
 	u32 base, len;
-	u8 rev, gatt;
+	u8  gatt;
 	int ret;
 
-	pci_read_config_byte(pcidev, PCI_CLASS_REVISION, &rev);
 	pr_info(DRV_NAME
 		": VIA SDMMC controller found at %s [%04x:%04x] (rev %x)\n",
 		pci_name(pcidev), (int)pcidev->vendor, (int)pcidev->device,
-		(int)rev);
+		(int)pcidev->revision);
 
 	ret = pci_enable_device(pcidev);
 	if (ret)
Acked-by on v1 1/1
#1 lore raw

Hi Sergei,

Quoted 7 lines · Sergei Shtylyov

The SDHCI driver uses PCI_CLASS_REVISION instead of PCI_REVISION_ID, so it was not converted by commit 44c10138fd4bbc4b6d6bff0873c24902f2a9da65 (PCI: Change all drivers to use pci_device->revision). The newer VIA driver has the similar code too. So convert both drivers to using the 'revision' field of 'struct pci_dev' now...

Signature · 3 lines
- Harald Welte <[email protected]>          	        http://gnumonks.org/
============================================================================
We all know Linux is great...it does infinite loops in 5 seconds. -- Linus