diff options
author | Dan Murphy <dmurphy@ti.com> | 2014-10-20 23:52:02 +0400 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2014-11-05 21:33:45 +0300 |
commit | 03045bcf312961cc75b2719aad6b4d69907884db (patch) | |
tree | 898933471e7f59def3dd109e5e999912a271efdb /drivers/iio | |
parent | 4748119f1889b4ce96c84831ad0581598081b46f (diff) | |
download | linux-03045bcf312961cc75b2719aad6b4d69907884db.tar.xz |
iio: tsl4531: Fix compiler error when CONFIG_PM_OPS is not defined
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>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio')
-rw-r--r-- | drivers/iio/light/tsl4531.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/iio/light/tsl4531.c b/drivers/iio/light/tsl4531.c index a15006efa137..0763b8632573 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, |