Dan Murphy
2014-10-20 19:52:02 UTC
=46ix the compiler error when the CONFIG_PM_OPS flag is not set.
drivers/iio/light/tsl4531.c:235:8: error: =E2=80=98tsl4531_suspend=E2=80=
=99 undeclared here (not in a function)
drivers/iio/light/tsl4531.c:235:8: error: =E2=80=98tsl4531_resume=E2=80=
=99 undeclared here (not in a function)
Signed-off-by: Dan Murphy <dmurphy-***@public.gmane.org>
---
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
=20
static SIMPLE_DEV_PM_OPS(tsl4531_pm_ops, tsl4531_suspend, tsl4531_resu=
me);
+#define TSL4531_PM_OPS (&tsl4531_pm_ops)
+#else
+#define TSL4531_PM_OPS NULL
+#endif
=20
static const struct i2c_device_id tsl4531_id[] =3D {
{ "tsl4531", 0 },
@@ -243,7 +246,7 @@ MODULE_DEVICE_TABLE(i2c, tsl4531_id);
static struct i2c_driver tsl4531_driver =3D {
.driver =3D {
.name =3D TSL4531_DRV_NAME,
- .pm =3D &tsl4531_pm_ops,
+ .pm =3D TSL4531_PM_OPS,
.owner =3D THIS_MODULE,
},
.probe =3D tsl4531_probe,
--=20
1.7.9.5
drivers/iio/light/tsl4531.c:235:8: error: =E2=80=98tsl4531_suspend=E2=80=
=99 undeclared here (not in a function)
drivers/iio/light/tsl4531.c:235:8: error: =E2=80=98tsl4531_resume=E2=80=
=99 undeclared here (not in a function)
Signed-off-by: Dan Murphy <dmurphy-***@public.gmane.org>
---
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
=20
static SIMPLE_DEV_PM_OPS(tsl4531_pm_ops, tsl4531_suspend, tsl4531_resu=
me);
+#define TSL4531_PM_OPS (&tsl4531_pm_ops)
+#else
+#define TSL4531_PM_OPS NULL
+#endif
=20
static const struct i2c_device_id tsl4531_id[] =3D {
{ "tsl4531", 0 },
@@ -243,7 +246,7 @@ MODULE_DEVICE_TABLE(i2c, tsl4531_id);
static struct i2c_driver tsl4531_driver =3D {
.driver =3D {
.name =3D TSL4531_DRV_NAME,
- .pm =3D &tsl4531_pm_ops,
+ .pm =3D TSL4531_PM_OPS,
.owner =3D THIS_MODULE,
},
.probe =3D tsl4531_probe,
--=20
1.7.9.5