Skip to content

Commit b7813f0

Browse files
ahunter6storulf
authored andcommitted
mmc: sdhci-pci: Conditionally compile pm sleep functions
It is confusing to have some parts of suspend / resume under conditional compilation and some parts not. Use conditional compilation everywhere. 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 1cb0a58 commit b7813f0

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ static int ricoh_mmc_probe_slot(struct sdhci_pci_slot *slot)
6767
return 0;
6868
}
6969

70+
#ifdef CONFIG_PM_SLEEP
7071
static int ricoh_mmc_resume(struct sdhci_pci_chip *chip)
7172
{
7273
/* Apply a delay to allow controller to settle */
@@ -75,6 +76,7 @@ static int ricoh_mmc_resume(struct sdhci_pci_chip *chip)
7576
msleep(500);
7677
return 0;
7778
}
79+
#endif
7880

7981
static const struct sdhci_pci_fixes sdhci_ricoh = {
8082
.probe = ricoh_probe,
@@ -85,7 +87,9 @@ static const struct sdhci_pci_fixes sdhci_ricoh = {
8587

8688
static const struct sdhci_pci_fixes sdhci_ricoh_mmc = {
8789
.probe_slot = ricoh_mmc_probe_slot,
90+
#ifdef CONFIG_PM_SLEEP
8891
.resume = ricoh_mmc_resume,
92+
#endif
8993
.quirks = SDHCI_QUIRK_32BIT_DMA_ADDR |
9094
SDHCI_QUIRK_CLOCK_BEFORE_RESET |
9195
SDHCI_QUIRK_NO_CARD_NO_RESET |
@@ -751,6 +755,7 @@ static void jmicron_remove_slot(struct sdhci_pci_slot *slot, int dead)
751755
jmicron_enable_mmc(slot->host, 0);
752756
}
753757

758+
#ifdef CONFIG_PM_SLEEP
754759
static int jmicron_suspend(struct sdhci_pci_chip *chip)
755760
{
756761
int i;
@@ -782,13 +787,16 @@ static int jmicron_resume(struct sdhci_pci_chip *chip)
782787

783788
return 0;
784789
}
790+
#endif
785791

786792
static const struct sdhci_pci_fixes sdhci_o2 = {
787793
.probe = sdhci_pci_o2_probe,
788794
.quirks = SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC,
789795
.quirks2 = SDHCI_QUIRK2_CLEAR_TRANSFERMODE_REG_BEFORE_CMD,
790796
.probe_slot = sdhci_pci_o2_probe_slot,
797+
#ifdef CONFIG_PM_SLEEP
791798
.resume = sdhci_pci_o2_resume,
799+
#endif
792800
};
793801

794802
static const struct sdhci_pci_fixes sdhci_jmicron = {
@@ -797,8 +805,10 @@ static const struct sdhci_pci_fixes sdhci_jmicron = {
797805
.probe_slot = jmicron_probe_slot,
798806
.remove_slot = jmicron_remove_slot,
799807

808+
#ifdef CONFIG_PM_SLEEP
800809
.suspend = jmicron_suspend,
801810
.resume = jmicron_resume,
811+
#endif
802812
};
803813

804814
/* SysKonnect CardBus2SDIO extra registers */

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,8 +384,10 @@ int sdhci_pci_o2_probe(struct sdhci_pci_chip *chip)
384384
return 0;
385385
}
386386

387+
#ifdef CONFIG_PM_SLEEP
387388
int sdhci_pci_o2_resume(struct sdhci_pci_chip *chip)
388389
{
389390
sdhci_pci_o2_probe(chip);
390391
return 0;
391392
}
393+
#endif

drivers/mmc/host/sdhci-pci.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,10 @@ struct sdhci_pci_fixes {
6767
int (*add_host) (struct sdhci_pci_slot *);
6868
void (*remove_slot) (struct sdhci_pci_slot *, int);
6969

70+
#ifdef CONFIG_PM_SLEEP
7071
int (*suspend) (struct sdhci_pci_chip *);
7172
int (*resume) (struct sdhci_pci_chip *);
73+
#endif
7274

7375
const struct sdhci_ops *ops;
7476
size_t priv_size;

0 commit comments

Comments
 (0)