linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iio: tsl4531: Fix compiler error when CONFIG_PM_OPS is not defined
@ 2014-10-20 19:52 Dan Murphy
  2014-10-25  9:51 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Murphy @ 2014-10-20 19:52 UTC (permalink / raw)
  To: jic23, pmeerw; +Cc: linux-iio, linux-kernel, Dan Murphy

Fix the compiler error when the CONFIG_PM_OPS flag is not set.

drivers/iio/light/tsl4531.c:235:8: error: ‘tsl4531_suspend’ undeclared here (not in a function)
drivers/iio/light/tsl4531.c:235:8: error: ‘tsl4531_resume’ undeclared here (not in a function)

Signed-off-by: Dan Murphy <dmurphy@ti.com>
---
 drivers/iio/light/tsl4531.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/light/tsl4531.c b/drivers/iio/light/tsl4531.c
index a15006e..0763b86 100644
--- a/drivers/iio/light/tsl4531.c
+++ b/drivers/iio/light/tsl4531.c
@@ -230,9 +230,12 @@ static int tsl4531_resume(struct device *dev)
 	return i2c_smbus_write_byte_data(to_i2c_client(dev), TSL4531_CONTROL,
 		TSL4531_MODE_NORMAL);
 }
-#endif
 
 static SIMPLE_DEV_PM_OPS(tsl4531_pm_ops, tsl4531_suspend, tsl4531_resume);
+#define TSL4531_PM_OPS (&tsl4531_pm_ops)
+#else
+#define TSL4531_PM_OPS NULL
+#endif
 
 static const struct i2c_device_id tsl4531_id[] = {
 	{ "tsl4531", 0 },
@@ -243,7 +246,7 @@ MODULE_DEVICE_TABLE(i2c, tsl4531_id);
 static struct i2c_driver tsl4531_driver = {
 	.driver = {
 		.name   = TSL4531_DRV_NAME,
-		.pm	= &tsl4531_pm_ops,
+		.pm	= TSL4531_PM_OPS,
 		.owner  = THIS_MODULE,
 	},
 	.probe  = tsl4531_probe,
-- 
1.7.9.5


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

* Re: [PATCH] iio: tsl4531: Fix compiler error when CONFIG_PM_OPS is not defined
  2014-10-20 19:52 [PATCH] iio: tsl4531: Fix compiler error when CONFIG_PM_OPS is not defined Dan Murphy
@ 2014-10-25  9:51 ` Jonathan Cameron
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2014-10-25  9:51 UTC (permalink / raw)
  To: Dan Murphy, pmeerw; +Cc: linux-iio, linux-kernel

On 20/10/14 20:52, Dan Murphy wrote:
> Fix the compiler error when the CONFIG_PM_OPS flag is not set.
> 
> drivers/iio/light/tsl4531.c:235:8: error: ‘tsl4531_suspend’ undeclared here (not in a function)
> drivers/iio/light/tsl4531.c:235:8: error: ‘tsl4531_resume’ undeclared here (not in a function)
> 
> Signed-off-by: Dan Murphy <dmurphy@ti.com>
Applied to the fixes-togreg branch of iio.git

Thanks,

Jonathan
> ---
>  drivers/iio/light/tsl4531.c |    7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/iio/light/tsl4531.c b/drivers/iio/light/tsl4531.c
> index a15006e..0763b86 100644
> --- a/drivers/iio/light/tsl4531.c
> +++ b/drivers/iio/light/tsl4531.c
> @@ -230,9 +230,12 @@ static int tsl4531_resume(struct device *dev)
>  	return i2c_smbus_write_byte_data(to_i2c_client(dev), TSL4531_CONTROL,
>  		TSL4531_MODE_NORMAL);
>  }
> -#endif
>  
>  static SIMPLE_DEV_PM_OPS(tsl4531_pm_ops, tsl4531_suspend, tsl4531_resume);
> +#define TSL4531_PM_OPS (&tsl4531_pm_ops)
> +#else
> +#define TSL4531_PM_OPS NULL
> +#endif
>  
>  static const struct i2c_device_id tsl4531_id[] = {
>  	{ "tsl4531", 0 },
> @@ -243,7 +246,7 @@ MODULE_DEVICE_TABLE(i2c, tsl4531_id);
>  static struct i2c_driver tsl4531_driver = {
>  	.driver = {
>  		.name   = TSL4531_DRV_NAME,
> -		.pm	= &tsl4531_pm_ops,
> +		.pm	= TSL4531_PM_OPS,
>  		.owner  = THIS_MODULE,
>  	},
>  	.probe  = tsl4531_probe,
> 

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

end of thread, other threads:[~2014-10-25 19:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-20 19:52 [PATCH] iio: tsl4531: Fix compiler error when CONFIG_PM_OPS is not defined Dan Murphy
2014-10-25  9:51 ` Jonathan Cameron

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).