Skip to content

Commit 61c951d

Browse files
ahunter6storulf
authored andcommitted
mmc: sdhci-pci: Let devices define how to add the host
SDHCI provides more flexibility than simply calling sdhci_add_host(). Make that available by allowing devices to specify their own ->add_host() function. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Tested-by: Ludovic Desroches <ludovic.desroches@microchip.com>
1 parent f12e39d commit 61c951d

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

drivers/mmc/host/sdhci-pci-core.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1949,7 +1949,10 @@ static struct sdhci_pci_slot *sdhci_pci_probe_slot(
19491949
}
19501950
}
19511951

1952-
ret = sdhci_add_host(host);
1952+
if (chip->fixes && chip->fixes->add_host)
1953+
ret = chip->fixes->add_host(slot);
1954+
else
1955+
ret = sdhci_add_host(host);
19531956
if (ret)
19541957
goto remove;
19551958

drivers/mmc/host/sdhci-pci.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ struct sdhci_pci_fixes {
6464
int (*probe) (struct sdhci_pci_chip *);
6565

6666
int (*probe_slot) (struct sdhci_pci_slot *);
67+
int (*add_host) (struct sdhci_pci_slot *);
6768
void (*remove_slot) (struct sdhci_pci_slot *, int);
6869

6970
int (*suspend) (struct sdhci_pci_chip *);

0 commit comments

Comments
 (0)