瀏覽代碼

mmc: sdhci-pci: Let devices define their own sdhci_ops

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>
Adrian Hunter 8 年之前
父節點
當前提交
6bc090631d
共有 2 個文件被更改,包括 5 次插入1 次删除
  1. 3 1
      drivers/mmc/host/sdhci-pci-core.c
  2. 2 0
      drivers/mmc/host/sdhci-pci.h

+ 3 - 1
drivers/mmc/host/sdhci-pci-core.c

@@ -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;
 

+ 2 - 0
drivers/mmc/host/sdhci-pci.h

@@ -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 {