aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuciano Coelho <coelho@ti.com>2011-10-07 07:14:25 -0400
committerLuciano Coelho <coelho@ti.com>2011-10-11 09:24:45 -0400
commit3c4d386868dcbfb9fa51427e314fde39ee70b0ff (patch)
tree23083987e2992a840fe44fadbbed522fbf72811b
parent0f4e31222a2c0b93f25a87effd2033cb78c7a79c (diff)
wl12xx: sdio: use dev_dbg instead of wl1271_debug
To prevent a useless dependency between the sdio module and the wl12xx module, we need to replace the wl1271_debug macros (and friends) for dev_dbg and other equivalents. At the same time, remove the SDIO data hexdump, since this produces way too much data and is not particularly useful. There's not print_hex_dump() equivalent for dynamic debug, so it's hard to control when the dumps are printed out. Signed-off-by: Luciano Coelho <coelho@ti.com>
-rw-r--r--drivers/net/wireless/wl12xx/sdio.c49
1 files changed, 23 insertions, 26 deletions
diff --git a/drivers/net/wireless/wl12xx/sdio.c b/drivers/net/wireless/wl12xx/sdio.c
index 55c63adb1d0f..57e72b4b8d22 100644
--- a/drivers/net/wireless/wl12xx/sdio.c
+++ b/drivers/net/wireless/wl12xx/sdio.c
@@ -34,7 +34,6 @@
34#include <linux/pm_runtime.h> 34#include <linux/pm_runtime.h>
35 35
36#include "wl12xx.h" 36#include "wl12xx.h"
37#include "debug.h"
38#include "wl12xx_80211.h" 37#include "wl12xx_80211.h"
39#include "io.h" 38#include "io.h"
40 39
@@ -77,21 +76,20 @@ static void wl12xx_sdio_raw_read(struct device *child, int addr, void *buf,
77 76
78 if (unlikely(addr == HW_ACCESS_ELP_CTRL_REG_ADDR)) { 77 if (unlikely(addr == HW_ACCESS_ELP_CTRL_REG_ADDR)) {
79 ((u8 *)buf)[0] = sdio_f0_readb(func, addr, &ret); 78 ((u8 *)buf)[0] = sdio_f0_readb(func, addr, &ret);
80 wl1271_debug(DEBUG_SDIO, "sdio read 52 addr 0x%x, byte 0x%02x", 79 dev_dbg(child->parent, "sdio read 52 addr 0x%x, byte 0x%02x\n",
81 addr, ((u8 *)buf)[0]); 80 addr, ((u8 *)buf)[0]);
82 } else { 81 } else {
83 if (fixed) 82 if (fixed)
84 ret = sdio_readsb(func, buf, addr, len); 83 ret = sdio_readsb(func, buf, addr, len);
85 else 84 else
86 ret = sdio_memcpy_fromio(func, buf, addr, len); 85 ret = sdio_memcpy_fromio(func, buf, addr, len);
87 86
88 wl1271_debug(DEBUG_SDIO, "sdio read 53 addr 0x%x, %zu bytes", 87 dev_dbg(child->parent, "sdio read 53 addr 0x%x, %zu bytes\n",
89 addr, len); 88 addr, len);
90 wl1271_dump_ascii(DEBUG_SDIO, "data: ", buf, len);
91 } 89 }
92 90
93 if (ret) 91 if (ret)
94 wl1271_error("sdio read failed (%d)", ret); 92 dev_err(child->parent, "sdio read failed (%d)\n", ret);
95} 93}
96 94
97static void wl12xx_sdio_raw_write(struct device *child, int addr, void *buf, 95static void wl12xx_sdio_raw_write(struct device *child, int addr, void *buf,
@@ -103,12 +101,11 @@ static void wl12xx_sdio_raw_write(struct device *child, int addr, void *buf,
103 101
104 if (unlikely(addr == HW_ACCESS_ELP_CTRL_REG_ADDR)) { 102 if (unlikely(addr == HW_ACCESS_ELP_CTRL_REG_ADDR)) {
105 sdio_f0_writeb(func, ((u8 *)buf)[0], addr, &ret); 103 sdio_f0_writeb(func, ((u8 *)buf)[0], addr, &ret);
106 wl1271_debug(DEBUG_SDIO, "sdio write 52 addr 0x%x, byte 0x%02x", 104 dev_dbg(child->parent, "sdio write 52 addr 0x%x, byte 0x%02x\n",
107 addr, ((u8 *)buf)[0]); 105 addr, ((u8 *)buf)[0]);
108 } else { 106 } else {
109 wl1271_debug(DEBUG_SDIO, "sdio write 53 addr 0x%x, %zu bytes", 107 dev_dbg(child->parent, "sdio write 53 addr 0x%x, %zu bytes\n",
110 addr, len); 108 addr, len);
111 wl1271_dump_ascii(DEBUG_SDIO, "data: ", buf, len);
112 109
113 if (fixed) 110 if (fixed)
114 ret = sdio_writesb(func, addr, buf, len); 111 ret = sdio_writesb(func, addr, buf, len);
@@ -117,7 +114,7 @@ static void wl12xx_sdio_raw_write(struct device *child, int addr, void *buf,
117 } 114 }
118 115
119 if (ret) 116 if (ret)
120 wl1271_error("sdio write failed (%d)", ret); 117 dev_err(child->parent, "sdio write failed (%d)\n", ret);
121} 118}
122 119
123static int wl12xx_sdio_power_on(struct wl12xx_sdio_glue *glue) 120static int wl12xx_sdio_power_on(struct wl12xx_sdio_glue *glue)
@@ -196,7 +193,7 @@ static int __devinit wl1271_probe(struct sdio_func *func,
196 193
197 glue = kzalloc(sizeof(*glue), GFP_KERNEL); 194 glue = kzalloc(sizeof(*glue), GFP_KERNEL);
198 if (!glue) { 195 if (!glue) {
199 wl1271_error("can't allocate glue"); 196 dev_err(&func->dev, "can't allocate glue\n");
200 goto out; 197 goto out;
201 } 198 }
202 199
@@ -211,13 +208,13 @@ static int __devinit wl1271_probe(struct sdio_func *func,
211 wlan_data = wl12xx_get_platform_data(); 208 wlan_data = wl12xx_get_platform_data();
212 if (IS_ERR(wlan_data)) { 209 if (IS_ERR(wlan_data)) {
213 ret = PTR_ERR(wlan_data); 210 ret = PTR_ERR(wlan_data);
214 wl1271_error("missing wlan platform data: %d", ret); 211 dev_err(glue->dev, "missing wlan platform data: %d\n", ret);
215 goto out_free_glue; 212 goto out_free_glue;
216 } 213 }
217 214
218 /* if sdio can keep power while host is suspended, enable wow */ 215 /* if sdio can keep power while host is suspended, enable wow */
219 mmcflags = sdio_get_host_pm_caps(func); 216 mmcflags = sdio_get_host_pm_caps(func);
220 wl1271_debug(DEBUG_SDIO, "sdio PM caps = 0x%x", mmcflags); 217 dev_dbg(glue->dev, "sdio PM caps = 0x%x\n", mmcflags);
221 218
222 if (mmcflags & MMC_PM_KEEP_POWER) 219 if (mmcflags & MMC_PM_KEEP_POWER)
223 wlan_data->pwr_in_suspend = true; 220 wlan_data->pwr_in_suspend = true;
@@ -231,7 +228,7 @@ static int __devinit wl1271_probe(struct sdio_func *func,
231 228
232 glue->core = platform_device_alloc("wl12xx-sdio", -1); 229 glue->core = platform_device_alloc("wl12xx-sdio", -1);
233 if (!glue->core) { 230 if (!glue->core) {
234 wl1271_error("can't allocate platform_device"); 231 dev_err(glue->dev, "can't allocate platform_device");
235 ret = -ENOMEM; 232 ret = -ENOMEM;
236 goto out_free_glue; 233 goto out_free_glue;
237 } 234 }
@@ -246,20 +243,20 @@ static int __devinit wl1271_probe(struct sdio_func *func,
246 243
247 ret = platform_device_add_resources(glue->core, res, ARRAY_SIZE(res)); 244 ret = platform_device_add_resources(glue->core, res, ARRAY_SIZE(res));
248 if (ret) { 245 if (ret) {
249 wl1271_error("can't add resources"); 246 dev_err(glue->dev, "can't add resources\n");
250 goto out_dev_put; 247 goto out_dev_put;
251 } 248 }
252 249
253 ret = platform_device_add_data(glue->core, wlan_data, 250 ret = platform_device_add_data(glue->core, wlan_data,
254 sizeof(*wlan_data)); 251 sizeof(*wlan_data));
255 if (ret) { 252 if (ret) {
256 wl1271_error("can't add platform data"); 253 dev_err(glue->dev, "can't add platform data\n");
257 goto out_dev_put; 254 goto out_dev_put;
258 } 255 }
259 256
260 ret = platform_device_add(glue->core); 257 ret = platform_device_add(glue->core);
261 if (ret) { 258 if (ret) {
262 wl1271_error("can't add platform device"); 259 dev_err(glue->dev, "can't add platform device\n");
263 goto out_dev_put; 260 goto out_dev_put;
264 } 261 }
265 return 0; 262 return 0;
@@ -296,16 +293,16 @@ static int wl1271_suspend(struct device *dev)
296 mmc_pm_flag_t sdio_flags; 293 mmc_pm_flag_t sdio_flags;
297 int ret = 0; 294 int ret = 0;
298 295
299 wl1271_debug(DEBUG_MAC80211, "wl1271 suspend. wow_enabled: %d", 296 dev_dbg(dev, "wl1271 suspend. wow_enabled: %d\n",
300 wl->wow_enabled); 297 wl->wow_enabled);
301 298
302 /* check whether sdio should keep power */ 299 /* check whether sdio should keep power */
303 if (wl->wow_enabled) { 300 if (wl->wow_enabled) {
304 sdio_flags = sdio_get_host_pm_caps(func); 301 sdio_flags = sdio_get_host_pm_caps(func);
305 302
306 if (!(sdio_flags & MMC_PM_KEEP_POWER)) { 303 if (!(sdio_flags & MMC_PM_KEEP_POWER)) {
307 wl1271_error("can't keep power while host " 304 dev_err(dev, "can't keep power while host "
308 "is suspended"); 305 "is suspended\n");
309 ret = -EINVAL; 306 ret = -EINVAL;
310 goto out; 307 goto out;
311 } 308 }
@@ -313,7 +310,7 @@ static int wl1271_suspend(struct device *dev)
313 /* keep power while host suspended */ 310 /* keep power while host suspended */
314 ret = sdio_set_host_pm_flags(func, MMC_PM_KEEP_POWER); 311 ret = sdio_set_host_pm_flags(func, MMC_PM_KEEP_POWER);
315 if (ret) { 312 if (ret) {
316 wl1271_error("error while trying to keep power"); 313 dev_err(dev, "error while trying to keep power\n");
317 goto out; 314 goto out;
318 } 315 }
319 316
@@ -329,7 +326,7 @@ static int wl1271_resume(struct device *dev)
329 struct sdio_func *func = dev_to_sdio_func(dev); 326 struct sdio_func *func = dev_to_sdio_func(dev);
330 struct wl1271 *wl = sdio_get_drvdata(func); 327 struct wl1271 *wl = sdio_get_drvdata(func);
331 328
332 wl1271_debug(DEBUG_MAC80211, "wl1271 resume"); 329 dev_dbg(dev, "wl1271 resume\n");
333 if (wl->wow_enabled) { 330 if (wl->wow_enabled) {
334 /* claim back host */ 331 /* claim back host */
335 sdio_claim_host(func); 332 sdio_claim_host(func);