From: Guenter Roeck <linux@roeck-us.net>
To: Jonathan Cameron <jic23@kernel.org>
Cc: "Jean Delvare" <jdelvare@suse.com>,
linux-hwmon@vger.kernel.org,
"Paul Cercueil" <paul@crapouillou.net>,
"Hans de Goede" <hdegoede@redhat.com>,
"Rafael J . Wysocki" <rafael.j.wysocki@intel.com>,
"Lars-Peter Clausen" <lars@metafoo.de>,
"Linus Walleij" <linus.walleij@linaro.org>,
"Nuno Sá" <nuno.sa@analog.com>,
"Roland Stigge" <stigge@antcom.de>,
"Zoltán Kővágó" <dirty.ice.hu@gmail.com>,
"Ninad Malwade" <nmalwade@nvidia.com>,
"Jonathan Cameron" <Jonathan.Cameron@huawei.com>
Subject: Re: [PATCH 05/18] hwmon: (gpio-fan) Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
Date: Sun, 25 Sep 2022 11:49:54 -0700 [thread overview]
Message-ID: <20220925184954.GA2856297@roeck-us.net> (raw)
In-Reply-To: <20220925172759.3573439-6-jic23@kernel.org>
On Sun, Sep 25, 2022 at 06:27:46PM +0100, Jonathan Cameron wrote:
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>
> These newer PM macros allow the compiler to see what code it can remove
> if !CONFIG_PM_SLEEP. This allows the removal of messy #ifdef barriers whilst
> achieving the same result.
>
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
This patch resulted in build errors.
Building m68k:allmodconfig ... failed
--------------
Error log:
drivers/hwmon/gpio-fan.c: In function 'gpio_fan_suspend':
drivers/hwmon/gpio-fan.c:565:27: error: 'struct gpio_fan_data' has no member named 'resume_speed'
There was an #ifdef CONFIG_PM_SLEEP in struct gpio_fan_data which had
to be dropped. I took care of that.
Guenter
> ---
> drivers/hwmon/gpio-fan.c | 9 ++-------
> 1 file changed, 2 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/hwmon/gpio-fan.c b/drivers/hwmon/gpio-fan.c
> index fbf3f5a4ecb6..b05aedd20b4f 100644
> --- a/drivers/hwmon/gpio-fan.c
> +++ b/drivers/hwmon/gpio-fan.c
> @@ -557,7 +557,6 @@ static void gpio_fan_shutdown(struct platform_device *pdev)
> set_fan_speed(fan_data, 0);
> }
>
> -#ifdef CONFIG_PM_SLEEP
> static int gpio_fan_suspend(struct device *dev)
> {
> struct gpio_fan_data *fan_data = dev_get_drvdata(dev);
> @@ -580,18 +579,14 @@ static int gpio_fan_resume(struct device *dev)
> return 0;
> }
>
> -static SIMPLE_DEV_PM_OPS(gpio_fan_pm, gpio_fan_suspend, gpio_fan_resume);
> -#define GPIO_FAN_PM (&gpio_fan_pm)
> -#else
> -#define GPIO_FAN_PM NULL
> -#endif
> +static DEFINE_SIMPLE_DEV_PM_OPS(gpio_fan_pm, gpio_fan_suspend, gpio_fan_resume);
>
> static struct platform_driver gpio_fan_driver = {
> .probe = gpio_fan_probe,
> .shutdown = gpio_fan_shutdown,
> .driver = {
> .name = "gpio-fan",
> - .pm = GPIO_FAN_PM,
> + .pm = pm_sleep_ptr(&gpio_fan_pm),
> .of_match_table = of_match_ptr(of_gpio_fan_match),
> },
> };
next prev parent reply other threads:[~2022-09-25 18:50 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-25 17:27 [PATCH 00/18] hwmon: Move to new PM macros reducing driver complexity Jonathan Cameron
2022-09-25 17:27 ` [PATCH 01/18] hwmon: (abitguru) Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() Jonathan Cameron
2022-09-25 17:27 ` [PATCH 02/18] hwmon: (abitguru3) " Jonathan Cameron
2022-09-25 17:27 ` [PATCH 03/18] hwmon: (acpi_power_meter) " Jonathan Cameron
2022-09-25 17:27 ` [PATCH 04/18] hwmon: (adt7x10) Switch to EXPORT_SIMPLE_DEV_PM_OPS() " Jonathan Cameron
2022-09-25 17:27 ` [PATCH 05/18] hwmon: (gpio-fan) Switch to DEFINE_SIMPLE_DEV_PM_OPS() " Jonathan Cameron
2022-09-25 18:49 ` Guenter Roeck [this message]
2022-09-26 8:32 ` Jonathan Cameron
2022-09-25 17:27 ` [PATCH 06/18] hwmon: (it87) " Jonathan Cameron
2022-09-25 17:27 ` [PATCH 07/18] hwmon: (lm90) " Jonathan Cameron
2022-09-25 17:27 ` [PATCH 08/18] hwmon: (ltc2947) Switch to EXPORT_SIMPLE_DEV_PM_OPS() " Jonathan Cameron
2022-09-25 17:27 ` [PATCH 09/18] hwmon: (max31722) Switch to DEFINE_SIMPLE_DEV_PM_OPS() " Jonathan Cameron
2022-09-25 17:27 ` [PATCH 10/18] hwmon: (max31730) witch " Jonathan Cameron
2022-09-25 17:27 ` [PATCH 11/18] hwmon: (max6639) Switch " Jonathan Cameron
2022-09-25 17:27 ` [PATCH 12/18] hwmon: (nct6775) " Jonathan Cameron
2022-09-25 17:27 ` [PATCH 13/18] hwmon: (pwm-fan) " Jonathan Cameron
2022-09-25 17:27 ` [PATCH 14/18] hwmon: (tmp102) " Jonathan Cameron
2022-09-25 17:27 ` [PATCH 15/18] hwmon: (tmp103) " Jonathan Cameron
2022-09-25 17:27 ` [PATCH 16/18] hwmon: (tmp108) " Jonathan Cameron
2022-09-25 17:27 ` [PATCH 17/18] hwmon: (w83627ehf) " Jonathan Cameron
2022-09-25 17:27 ` [PATCH 18/18] hwmon: (ina3221) Use DEFINE_RUNTIME_DEV_PM_OPS() and pm_ptr() Jonathan Cameron
2022-09-25 17:47 ` [PATCH 00/18] hwmon: Move to new PM macros reducing driver complexity Guenter Roeck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220925184954.GA2856297@roeck-us.net \
--to=linux@roeck-us.net \
--cc=Jonathan.Cameron@huawei.com \
--cc=dirty.ice.hu@gmail.com \
--cc=hdegoede@redhat.com \
--cc=jdelvare@suse.com \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=linus.walleij@linaro.org \
--cc=linux-hwmon@vger.kernel.org \
--cc=nmalwade@nvidia.com \
--cc=nuno.sa@analog.com \
--cc=paul@crapouillou.net \
--cc=rafael.j.wysocki@intel.com \
--cc=stigge@antcom.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox