linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] pwm: pca9685: replace CONFIG_PM with __maybe_unused to prevent build issues
@ 2020-03-11 15:43 Rishi Gupta
  2020-03-11 16:44 ` Uwe Kleine-König
  0 siblings, 1 reply; 5+ messages in thread
From: Rishi Gupta @ 2020-03-11 15:43 UTC (permalink / raw)
  To: thierry.reding, u.kleine-koenig, s.trumtrar
  Cc: linux-pwm, linux-kernel, Rishi Gupta

The __maybe_unused attribute is preferred over CONFIG_PM
to prevent build time issues. This commit replaces CONFIG_PM
with this attribute.

Signed-off-by: Rishi Gupta <gupt21@gmail.com>
---
 drivers/pwm/pwm-pca9685.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/pwm/pwm-pca9685.c b/drivers/pwm/pwm-pca9685.c
index b07bdca..b2a9e77 100644
--- a/drivers/pwm/pwm-pca9685.c
+++ b/drivers/pwm/pwm-pca9685.c
@@ -512,8 +512,7 @@ static int pca9685_pwm_remove(struct i2c_client *client)
 	return 0;
 }
 
-#ifdef CONFIG_PM
-static int pca9685_pwm_runtime_suspend(struct device *dev)
+static int __maybe_unused pca9685_pwm_runtime_suspend(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct pca9685 *pca = i2c_get_clientdata(client);
@@ -522,7 +521,7 @@ static int pca9685_pwm_runtime_suspend(struct device *dev)
 	return 0;
 }
 
-static int pca9685_pwm_runtime_resume(struct device *dev)
+static int __maybe_unused pca9685_pwm_runtime_resume(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct pca9685 *pca = i2c_get_clientdata(client);
@@ -530,7 +529,6 @@ static int pca9685_pwm_runtime_resume(struct device *dev)
 	pca9685_set_sleep_mode(pca, false);
 	return 0;
 }
-#endif
 
 static const struct i2c_device_id pca9685_id[] = {
 	{ "pca9685", 0 },
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] pwm: pca9685: replace CONFIG_PM with __maybe_unused to prevent build issues
  2020-03-11 15:43 [PATCH 1/1] pwm: pca9685: replace CONFIG_PM with __maybe_unused to prevent build issues Rishi Gupta
@ 2020-03-11 16:44 ` Uwe Kleine-König
  2020-03-11 19:46   ` rishi gupta
  0 siblings, 1 reply; 5+ messages in thread
From: Uwe Kleine-König @ 2020-03-11 16:44 UTC (permalink / raw)
  To: Rishi Gupta; +Cc: thierry.reding, s.trumtrar, linux-pwm, linux-kernel

On Wed, Mar 11, 2020 at 09:13:49PM +0530, Rishi Gupta wrote:
> The __maybe_unused attribute is preferred over CONFIG_PM
> to prevent build time issues. This commit replaces CONFIG_PM
> with this attribute.

I wasn't aware of build time issues and thought this was just about
#ifdef being ugly.

Anyhow, the change is fine,

Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>


-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] pwm: pca9685: replace CONFIG_PM with __maybe_unused to prevent build issues
  2020-03-11 16:44 ` Uwe Kleine-König
@ 2020-03-11 19:46   ` rishi gupta
  2020-03-11 19:55     ` Uwe Kleine-König
  0 siblings, 1 reply; 5+ messages in thread
From: rishi gupta @ 2020-03-11 19:46 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: thierry.reding, s.trumtrar, linux-pwm, lkml

These 2 links contains more details:
https://lore.kernel.org/patchwork/patch/732981
https://lkml.org/lkml/2019/1/17/437

On Wed, Mar 11, 2020 at 10:14 PM Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> wrote:
>
> On Wed, Mar 11, 2020 at 09:13:49PM +0530, Rishi Gupta wrote:
> > The __maybe_unused attribute is preferred over CONFIG_PM
> > to prevent build time issues. This commit replaces CONFIG_PM
> > with this attribute.
>
> I wasn't aware of build time issues and thought this was just about
> #ifdef being ugly.
>
> Anyhow, the change is fine,
>
> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
>
>
> --
> Pengutronix e.K.                           | Uwe Kleine-König            |
> Industrial Linux Solutions                 | https://www.pengutronix.de/ |

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] pwm: pca9685: replace CONFIG_PM with __maybe_unused to prevent build issues
  2020-03-11 19:46   ` rishi gupta
@ 2020-03-11 19:55     ` Uwe Kleine-König
  2020-03-21  5:56       ` rishi gupta
  0 siblings, 1 reply; 5+ messages in thread
From: Uwe Kleine-König @ 2020-03-11 19:55 UTC (permalink / raw)
  To: rishi gupta; +Cc: thierry.reding, s.trumtrar, linux-pwm, lkml

On Thu, Mar 12, 2020 at 01:16:28AM +0530, rishi gupta wrote:
> These 2 links contains more details:
> https://lore.kernel.org/patchwork/patch/732981
> https://lkml.org/lkml/2019/1/17/437

These are both about SIMPLE_DEV_PM_OPS which doesn't apply to
pwm-pca9685.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] pwm: pca9685: replace CONFIG_PM with __maybe_unused to prevent build issues
  2020-03-11 19:55     ` Uwe Kleine-König
@ 2020-03-21  5:56       ` rishi gupta
  0 siblings, 0 replies; 5+ messages in thread
From: rishi gupta @ 2020-03-21  5:56 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: thierry.reding, s.trumtrar, linux-pwm, lkml

Tested again and found one gerrit was missing in my local build.
Both __maybe_unused and CONFIG_PM are working fine.

So it is your choice to apply or not apply this patch.

Regards,
Rishi

On Thu, Mar 12, 2020 at 1:25 AM Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> wrote:
>
> On Thu, Mar 12, 2020 at 01:16:28AM +0530, rishi gupta wrote:
> > These 2 links contains more details:
> > https://lore.kernel.org/patchwork/patch/732981
> > https://lkml.org/lkml/2019/1/17/437
>
> These are both about SIMPLE_DEV_PM_OPS which doesn't apply to
> pwm-pca9685.
>
> Best regards
> Uwe
>
> --
> Pengutronix e.K.                           | Uwe Kleine-König            |
> Industrial Linux Solutions                 | https://www.pengutronix.de/ |

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-03-21  5:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-11 15:43 [PATCH 1/1] pwm: pca9685: replace CONFIG_PM with __maybe_unused to prevent build issues Rishi Gupta
2020-03-11 16:44 ` Uwe Kleine-König
2020-03-11 19:46   ` rishi gupta
2020-03-11 19:55     ` Uwe Kleine-König
2020-03-21  5:56       ` rishi gupta

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).