Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1571690 > unrolled thread
| Started by | Arnd Bergmann <arnd@arndb.de> |
|---|---|
| First post | 2017-02-01 17:20 +0100 |
| Last post | 2017-02-06 11:10 +0100 |
| Articles | 3 — 3 participants |
Back to article view | Back to linux.kernel
[PATCH] pinctrl: samsung: mark PM functions as __maybe_unused Arnd Bergmann <arnd@arndb.de> - 2017-02-01 17:20 +0100
Re: [PATCH] pinctrl: samsung: mark PM functions as __maybe_unused Marek Szyprowski <m.szyprowski@samsung.com> - 2017-02-02 08:00 +0100
Re: [PATCH] pinctrl: samsung: mark PM functions as __maybe_unused Linus Walleij <linus.walleij@linaro.org> - 2017-02-06 11:10 +0100
| From | Arnd Bergmann <arnd@arndb.de> |
|---|---|
| Date | 2017-02-01 17:20 +0100 |
| Subject | [PATCH] pinctrl: samsung: mark PM functions as __maybe_unused |
| Message-ID | <t65Nw-8ap-11@gated-at.bofh.it> |
The rework of the suspend/resume handling uses the wrong #ifdef check, leading
to a build warning without CONFIG_PM_SLEEP:
drivers/pinctrl/samsung/pinctrl-samsung.c:1142:12: error: 'samsung_pinctrl_resume' defined but not used [-Werror=unused-function]
drivers/pinctrl/samsung/pinctrl-samsung.c:1092:12: error: 'samsung_pinctrl_suspend' defined but not used [-Werror=unused-function]
Using a __maybe_unused annotation instead of the #ifdef is a simple way to
avoid this problem class.
Fixes: 2b24efa8e5c5 ("pinctrl: samsung: Replace syscore ops with standard platform device pm_ops")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/pinctrl/samsung/pinctrl-samsung.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/pinctrl/samsung/pinctrl-samsung.c b/drivers/pinctrl/samsung/pinctrl-samsung.c
index d79eadad6c5f..d601b5303e73 100644
--- a/drivers/pinctrl/samsung/pinctrl-samsung.c
+++ b/drivers/pinctrl/samsung/pinctrl-samsung.c
@@ -1083,13 +1083,12 @@ static int samsung_pinctrl_probe(struct platform_device *pdev)
return 0;
}
-#ifdef CONFIG_PM
/**
* samsung_pinctrl_suspend - save pinctrl state for suspend
*
* Save data for all banks handled by this device.
*/
-static int samsung_pinctrl_suspend(struct device *dev)
+static int __maybe_unused samsung_pinctrl_suspend(struct device *dev)
{
struct samsung_pinctrl_drv_data *drvdata = dev_get_drvdata(dev);
int i;
@@ -1139,7 +1138,7 @@ static int samsung_pinctrl_suspend(struct device *dev)
* We don't bother doing anything complicated to avoid glitching lines since
* we're called before pad retention is turned off.
*/
-static int samsung_pinctrl_resume(struct device *dev)
+static int __maybe_unused samsung_pinctrl_resume(struct device *dev)
{
struct samsung_pinctrl_drv_data *drvdata = dev_get_drvdata(dev);
int i;
@@ -1183,7 +1182,6 @@ static int samsung_pinctrl_resume(struct device *dev)
return 0;
}
-#endif
static const struct of_device_id samsung_pinctrl_dt_match[] = {
#ifdef CONFIG_PINCTRL_EXYNOS
--
2.9.0
[toc] | [next] | [standalone]
| From | Marek Szyprowski <m.szyprowski@samsung.com> |
|---|---|
| Date | 2017-02-02 08:00 +0100 |
| Message-ID | <t6jx8-mr-5@gated-at.bofh.it> |
| In reply to | #1571690 |
Hi Arnd,
On 2017-02-01 17:16, Arnd Bergmann wrote:
> The rework of the suspend/resume handling uses the wrong #ifdef check, leading
> to a build warning without CONFIG_PM_SLEEP:
>
> drivers/pinctrl/samsung/pinctrl-samsung.c:1142:12: error: 'samsung_pinctrl_resume' defined but not used [-Werror=unused-function]
> drivers/pinctrl/samsung/pinctrl-samsung.c:1092:12: error: 'samsung_pinctrl_suspend' defined but not used [-Werror=unused-function]
>
> Using a __maybe_unused annotation instead of the #ifdef is a simple way to
> avoid this problem class.
>
> Fixes: 2b24efa8e5c5 ("pinctrl: samsung: Replace syscore ops with standard platform device pm_ops")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Thanks for the fix!
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
> ---
> drivers/pinctrl/samsung/pinctrl-samsung.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/pinctrl/samsung/pinctrl-samsung.c b/drivers/pinctrl/samsung/pinctrl-samsung.c
> index d79eadad6c5f..d601b5303e73 100644
> --- a/drivers/pinctrl/samsung/pinctrl-samsung.c
> +++ b/drivers/pinctrl/samsung/pinctrl-samsung.c
> @@ -1083,13 +1083,12 @@ static int samsung_pinctrl_probe(struct platform_device *pdev)
> return 0;
> }
>
> -#ifdef CONFIG_PM
> /**
> * samsung_pinctrl_suspend - save pinctrl state for suspend
> *
> * Save data for all banks handled by this device.
> */
> -static int samsung_pinctrl_suspend(struct device *dev)
> +static int __maybe_unused samsung_pinctrl_suspend(struct device *dev)
> {
> struct samsung_pinctrl_drv_data *drvdata = dev_get_drvdata(dev);
> int i;
> @@ -1139,7 +1138,7 @@ static int samsung_pinctrl_suspend(struct device *dev)
> * We don't bother doing anything complicated to avoid glitching lines since
> * we're called before pad retention is turned off.
> */
> -static int samsung_pinctrl_resume(struct device *dev)
> +static int __maybe_unused samsung_pinctrl_resume(struct device *dev)
> {
> struct samsung_pinctrl_drv_data *drvdata = dev_get_drvdata(dev);
> int i;
> @@ -1183,7 +1182,6 @@ static int samsung_pinctrl_resume(struct device *dev)
>
> return 0;
> }
> -#endif
>
> static const struct of_device_id samsung_pinctrl_dt_match[] = {
> #ifdef CONFIG_PINCTRL_EXYNOS
Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland
[toc] | [prev] | [next] | [standalone]
| From | Linus Walleij <linus.walleij@linaro.org> |
|---|---|
| Date | 2017-02-06 11:10 +0100 |
| Message-ID | <t7Opb-3AB-7@gated-at.bofh.it> |
| In reply to | #1571690 |
On Wed, Feb 1, 2017 at 5:16 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> The rework of the suspend/resume handling uses the wrong #ifdef check, leading
> to a build warning without CONFIG_PM_SLEEP:
>
> drivers/pinctrl/samsung/pinctrl-samsung.c:1142:12: error: 'samsung_pinctrl_resume' defined but not used [-Werror=unused-function]
> drivers/pinctrl/samsung/pinctrl-samsung.c:1092:12: error: 'samsung_pinctrl_suspend' defined but not used [-Werror=unused-function]
>
> Using a __maybe_unused annotation instead of the #ifdef is a simple way to
> avoid this problem class.
>
> Fixes: 2b24efa8e5c5 ("pinctrl: samsung: Replace syscore ops with standard platform device pm_ops")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Patch applied with Marek's ACK.
Yours,
Linus Walleij
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web