mmc: sdhci-pci: Let devices define their own sdhci_ops
authorAdrian Hunter <adrian.hunter@intel.com>
Wed, 5 Oct 2016 09:11:23 +0000 (12:11 +0300)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 10 Oct 2016 12:20:48 +0000 (14:20 +0200)
Let devices define their own sdhci_ops so that device-specific variations
can be implemented without adding quirks.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/sdhci-pci-core.c
drivers/mmc/host/sdhci-pci.h

index 72a1f1f5180a9cc12f5bdc7fffaa03685500f6e0..5e11e0e3be63f2f080f1c21a37fcf96b7d74dc32 100644 (file)
@@ -1648,7 +1648,9 @@ static struct sdhci_pci_slot *sdhci_pci_probe_slot(
        }
 
        host->hw_name = "PCI";
-       host->ops = &sdhci_pci_ops;
+       host->ops = chip->fixes && chip->fixes->ops ?
+                   chip->fixes->ops :
+                   &sdhci_pci_ops;
        host->quirks = chip->quirks;
        host->quirks2 = chip->quirks2;
 
index 9c7c08b9322387f7914024ed404055ed7ba158cb..6bccf56bc5fff654d203ead074a6a53ae0409623 100644 (file)
@@ -65,6 +65,8 @@ struct sdhci_pci_fixes {
 
        int                     (*suspend) (struct sdhci_pci_chip *);
        int                     (*resume) (struct sdhci_pci_chip *);
+
+       const struct sdhci_ops  *ops;
 };
 
 struct sdhci_pci_slot {