diff mbox series

mmc: sdhci-pltfm: Fix linking err for sdhci-brcmstb

Message ID 20210126095230.26580-1-ulf.hansson@linaro.org
State New
Headers show
Series mmc: sdhci-pltfm: Fix linking err for sdhci-brcmstb | expand

Commit Message

Ulf Hansson Jan. 26, 2021, 9:52 a.m. UTC
The implementation of sdhci_pltfm_suspend() is only available when
CONFIG_PM_SLEEP is set, which triggers a linking error:

"undefined symbol: sdhci_pltfm_suspend" when building sdhci-brcmstb.c.

Fix this by implementing the missing stubs when CONFIG_PM_SLEEP is unset.

Reported-by: Arnd Bergmann <arnd@arndb.de>
Suggested-by: Florian Fainelli <f.fainelli@gmail.com>
Cc: Nicolas Schichan <nschichan@freebox.fr>
Fixes: 5b191dcba719 ("mmc: sdhci-brcmstb: Fix mmc timeout errors on S5 suspend")
Cc: stable@vger.kernel.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

---
 drivers/mmc/host/sdhci-pltfm.h | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

-- 
2.25.1

Comments

Nicolas Schichan Jan. 26, 2021, 12:27 p.m. UTC | #1
On Tue, Jan 26, 2021 at 10:52 AM Ulf Hansson <ulf.hansson@linaro.org> wrote:
>
> The implementation of sdhci_pltfm_suspend() is only available when
> CONFIG_PM_SLEEP is set, which triggers a linking error:
>
> "undefined symbol: sdhci_pltfm_suspend" when building sdhci-brcmstb.c.
>
> Fix this by implementing the missing stubs when CONFIG_PM_SLEEP is unset.
>
> Reported-by: Arnd Bergmann <arnd@arndb.de>
> Suggested-by: Florian Fainelli <f.fainelli@gmail.com>
> Cc: Nicolas Schichan <nschichan@freebox.fr>
> Fixes: 5b191dcba719 ("mmc: sdhci-brcmstb: Fix mmc timeout errors on S5 suspend")
> Cc: stable@vger.kernel.org
> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
> ---
>  drivers/mmc/host/sdhci-pltfm.h | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/sdhci-pltfm.h b/drivers/mmc/host/sdhci-pltfm.h
> index 6301b81cf573..9bd717ff784b 100644
> --- a/drivers/mmc/host/sdhci-pltfm.h
> +++ b/drivers/mmc/host/sdhci-pltfm.h
> @@ -111,8 +111,13 @@ static inline void *sdhci_pltfm_priv(struct sdhci_pltfm_host *host)
>         return host->private;
>  }
>
> +extern const struct dev_pm_ops sdhci_pltfm_pmops;
> +#ifdef CONFIG_PM_SLEEP
>  int sdhci_pltfm_suspend(struct device *dev);
>  int sdhci_pltfm_resume(struct device *dev);
> -extern const struct dev_pm_ops sdhci_pltfm_pmops;
> +#else
> +static inline int sdhci_pltfm_suspend(struct device *dev) { return 0; }
> +static inline int sdhci_pltfm_resume(struct device *dev) { return 0; }
> +#endif
>
>  #endif /* _DRIVERS_MMC_SDHCI_PLTFM_H */
> --
> 2.25.1
>

Hello,

I have just given this patch a test and no issues here, so:

Tested-By: Nicolas Schichan <nschichan@freeebox.fr>

Regards,

--
Nicolas Schichan
Arnd Bergmann Jan. 26, 2021, 2:09 p.m. UTC | #2
On Tue, Jan 26, 2021 at 10:52 AM Ulf Hansson <ulf.hansson@linaro.org> wrote:
>

> The implementation of sdhci_pltfm_suspend() is only available when

> CONFIG_PM_SLEEP is set, which triggers a linking error:

>

> "undefined symbol: sdhci_pltfm_suspend" when building sdhci-brcmstb.c.

>

> Fix this by implementing the missing stubs when CONFIG_PM_SLEEP is unset.

>

> Reported-by: Arnd Bergmann <arnd@arndb.de>

> Suggested-by: Florian Fainelli <f.fainelli@gmail.com>

> Cc: Nicolas Schichan <nschichan@freebox.fr>

> Fixes: 5b191dcba719 ("mmc: sdhci-brcmstb: Fix mmc timeout errors on S5 suspend")

> Cc: stable@vger.kernel.org

> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

> ---


Acked-by: Arnd Bergmann <arnd@arndb.de>
Florian Fainelli Jan. 26, 2021, 5:26 p.m. UTC | #3
+Al,

On 1/26/2021 1:52 AM, Ulf Hansson wrote:
> The implementation of sdhci_pltfm_suspend() is only available when
> CONFIG_PM_SLEEP is set, which triggers a linking error:
> 
> "undefined symbol: sdhci_pltfm_suspend" when building sdhci-brcmstb.c.
> 
> Fix this by implementing the missing stubs when CONFIG_PM_SLEEP is unset.
> 
> Reported-by: Arnd Bergmann <arnd@arndb.de>
> Suggested-by: Florian Fainelli <f.fainelli@gmail.com>
> Cc: Nicolas Schichan <nschichan@freebox.fr>
> Fixes: 5b191dcba719 ("mmc: sdhci-brcmstb: Fix mmc timeout errors on S5 suspend")
> Cc: stable@vger.kernel.org
> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

Acked-by: Florian Fainelli <f.fainelli@gmail.com>
diff mbox series

Patch

diff --git a/drivers/mmc/host/sdhci-pltfm.h b/drivers/mmc/host/sdhci-pltfm.h
index 6301b81cf573..9bd717ff784b 100644
--- a/drivers/mmc/host/sdhci-pltfm.h
+++ b/drivers/mmc/host/sdhci-pltfm.h
@@ -111,8 +111,13 @@  static inline void *sdhci_pltfm_priv(struct sdhci_pltfm_host *host)
 	return host->private;
 }
 
+extern const struct dev_pm_ops sdhci_pltfm_pmops;
+#ifdef CONFIG_PM_SLEEP
 int sdhci_pltfm_suspend(struct device *dev);
 int sdhci_pltfm_resume(struct device *dev);
-extern const struct dev_pm_ops sdhci_pltfm_pmops;
+#else
+static inline int sdhci_pltfm_suspend(struct device *dev) { return 0; }
+static inline int sdhci_pltfm_resume(struct device *dev) { return 0; }
+#endif
 
 #endif /* _DRIVERS_MMC_SDHCI_PLTFM_H */