diff options
author | Juuso Oikarinen <juuso.oikarinen@nokia.com> | 2009-12-11 08:41:07 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-12-28 16:31:35 -0500 |
commit | 71449f8d7059b69e6e45063997d225d8202221a2 (patch) | |
tree | 480496ab5644801421965c18fd329084c4df123d /drivers/net/wireless/wl12xx/wl1271_debugfs.c | |
parent | 830fb67b8e37fb03cf703b4e1217fe30ce32d579 (diff) |
wl1271: Change booleans in struct wl1271 into a flags bitmask
For cleaner implementation, change the bunch of booleans in the struct wl1271
structure into a flags bitmask.
Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Reviewed-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/wl12xx/wl1271_debugfs.c')
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271_debugfs.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271_debugfs.c b/drivers/net/wireless/wl12xx/wl1271_debugfs.c index 4eaf40c5756..8d7588ca68f 100644 --- a/drivers/net/wireless/wl12xx/wl1271_debugfs.c +++ b/drivers/net/wireless/wl12xx/wl1271_debugfs.c | |||
@@ -241,10 +241,12 @@ static ssize_t gpio_power_read(struct file *file, char __user *user_buf, | |||
241 | size_t count, loff_t *ppos) | 241 | size_t count, loff_t *ppos) |
242 | { | 242 | { |
243 | struct wl1271 *wl = file->private_data; | 243 | struct wl1271 *wl = file->private_data; |
244 | bool state = test_bit(WL1271_FLAG_GPIO_POWER, &wl->flags); | ||
245 | |||
244 | int res; | 246 | int res; |
245 | char buf[10]; | 247 | char buf[10]; |
246 | 248 | ||
247 | res = scnprintf(buf, sizeof(buf), "%d\n", wl->gpio_power); | 249 | res = scnprintf(buf, sizeof(buf), "%d\n", state); |
248 | 250 | ||
249 | return simple_read_from_buffer(user_buf, count, ppos, buf, res); | 251 | return simple_read_from_buffer(user_buf, count, ppos, buf, res); |
250 | } | 252 | } |
@@ -274,8 +276,13 @@ static ssize_t gpio_power_write(struct file *file, | |||
274 | goto out; | 276 | goto out; |
275 | } | 277 | } |
276 | 278 | ||
277 | wl->set_power(!!value); | 279 | if (value) { |
278 | wl->gpio_power = !!value; | 280 | wl->set_power(true); |
281 | set_bit(WL1271_FLAG_GPIO_POWER, &wl->flags); | ||
282 | } else { | ||
283 | wl->set_power(false); | ||
284 | clear_bit(WL1271_FLAG_GPIO_POWER, &wl->flags); | ||
285 | } | ||
279 | 286 | ||
280 | out: | 287 | out: |
281 | mutex_unlock(&wl->mutex); | 288 | mutex_unlock(&wl->mutex); |