aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSakari Ailus <sakari.ailus@linux.intel.com>2016-09-05 03:09:42 -0400
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2016-09-09 10:22:02 -0400
commit3933186aec80f66694cbf38ee21bb7011e935dcf (patch)
tree5880c5e5e9f8a36c61890425b03afa608b305c02
parent68429f50ab60074e58b98010103fcc5bac4afd54 (diff)
[media] ad5820: Use bool for boolean values
The driver used integers for what boolean would have been a better fit. Use boolean instead. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
-rw-r--r--drivers/media/i2c/ad5820.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/media/i2c/ad5820.c b/drivers/media/i2c/ad5820.c
index d7ad5c1a1219..fd4c5f67163d 100644
--- a/drivers/media/i2c/ad5820.c
+++ b/drivers/media/i2c/ad5820.c
@@ -58,7 +58,7 @@ struct ad5820_device {
58 struct mutex power_lock; 58 struct mutex power_lock;
59 int power_count; 59 int power_count;
60 60
61 unsigned int standby : 1; 61 bool standby;
62}; 62};
63 63
64static int ad5820_write(struct ad5820_device *coil, u16 data) 64static int ad5820_write(struct ad5820_device *coil, u16 data)
@@ -108,7 +108,7 @@ static int ad5820_update_hw(struct ad5820_device *coil)
108/* 108/*
109 * Power handling 109 * Power handling
110 */ 110 */
111static int ad5820_power_off(struct ad5820_device *coil, int standby) 111static int ad5820_power_off(struct ad5820_device *coil, bool standby)
112{ 112{
113 int ret = 0, ret2; 113 int ret = 0, ret2;
114 114
@@ -117,7 +117,7 @@ static int ad5820_power_off(struct ad5820_device *coil, int standby)
117 * (single power line control for both coil and sensor). 117 * (single power line control for both coil and sensor).
118 */ 118 */
119 if (standby) { 119 if (standby) {
120 coil->standby = 1; 120 coil->standby = true;
121 ret = ad5820_update_hw(coil); 121 ret = ad5820_update_hw(coil);
122 } 122 }
123 123
@@ -127,7 +127,7 @@ static int ad5820_power_off(struct ad5820_device *coil, int standby)
127 return ret2; 127 return ret2;
128} 128}
129 129
130static int ad5820_power_on(struct ad5820_device *coil, int restore) 130static int ad5820_power_on(struct ad5820_device *coil, bool restore)
131{ 131{
132 int ret; 132 int ret;
133 133
@@ -137,7 +137,7 @@ static int ad5820_power_on(struct ad5820_device *coil, int restore)
137 137
138 if (restore) { 138 if (restore) {
139 /* Restore the hardware settings. */ 139 /* Restore the hardware settings. */
140 coil->standby = 0; 140 coil->standby = false;
141 ret = ad5820_update_hw(coil); 141 ret = ad5820_update_hw(coil);
142 if (ret) 142 if (ret)
143 goto fail; 143 goto fail;
@@ -145,7 +145,7 @@ static int ad5820_power_on(struct ad5820_device *coil, int restore)
145 return 0; 145 return 0;
146 146
147fail: 147fail:
148 coil->standby = 1; 148 coil->standby = true;
149 regulator_disable(coil->vana); 149 regulator_disable(coil->vana);
150 150
151 return ret; 151 return ret;
@@ -227,7 +227,8 @@ ad5820_set_power(struct v4l2_subdev *subdev, int on)
227 * update the power state. 227 * update the power state.
228 */ 228 */
229 if (coil->power_count == !on) { 229 if (coil->power_count == !on) {
230 ret = on ? ad5820_power_on(coil, 1) : ad5820_power_off(coil, 1); 230 ret = on ? ad5820_power_on(coil, true) :
231 ad5820_power_off(coil, true);
231 if (ret < 0) 232 if (ret < 0)
232 goto done; 233 goto done;
233 } 234 }
@@ -279,7 +280,7 @@ static int ad5820_suspend(struct device *dev)
279 if (!coil->power_count) 280 if (!coil->power_count)
280 return 0; 281 return 0;
281 282
282 return ad5820_power_off(coil, 0); 283 return ad5820_power_off(coil, false);
283} 284}
284 285
285static int ad5820_resume(struct device *dev) 286static int ad5820_resume(struct device *dev)
@@ -291,7 +292,7 @@ static int ad5820_resume(struct device *dev)
291 if (!coil->power_count) 292 if (!coil->power_count)
292 return 0; 293 return 0;
293 294
294 return ad5820_power_on(coil, 1); 295 return ad5820_power_on(coil, true);
295} 296}
296 297
297#else 298#else