diff options
author | Joe Perches <joe@perches.com> | 2010-09-05 17:31:11 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-09-06 21:48:43 -0400 |
commit | b31fa5bad576cd8180a5ad70c648333b44320d44 (patch) | |
tree | b31239e8828e7e5b36ef85a0715ababc4f556e42 /net/caif/caif_dev.c | |
parent | a0ece28539d49c9bdcc6da0bbb26771dceb57581 (diff) |
net/caif: Use pr_fmt
This patch standardizes caif message logging prefixes.
Add #define pr_fmt(fmt) KBUILD_MODNAME ":%s(): " fmt, __func__
Add missing "\n"s to some logging messages
Convert pr_warning to pr_warn
This changes the logging message prefix from CAIF: to caif:
for all uses but caif_socket.c and chnl_net.c. Those now use
their filename without extension.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/caif/caif_dev.c')
-rw-r--r-- | net/caif/caif_dev.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/net/caif/caif_dev.c b/net/caif/caif_dev.c index 0b586e9d1378..1fdfe70392dc 100644 --- a/net/caif/caif_dev.c +++ b/net/caif/caif_dev.c | |||
@@ -9,6 +9,8 @@ | |||
9 | * and Sakari Ailus <sakari.ailus@nokia.com> | 9 | * and Sakari Ailus <sakari.ailus@nokia.com> |
10 | */ | 10 | */ |
11 | 11 | ||
12 | #define pr_fmt(fmt) KBUILD_MODNAME ":%s(): " fmt, __func__ | ||
13 | |||
12 | #include <linux/version.h> | 14 | #include <linux/version.h> |
13 | #include <linux/module.h> | 15 | #include <linux/module.h> |
14 | #include <linux/kernel.h> | 16 | #include <linux/kernel.h> |
@@ -214,7 +216,7 @@ static int caif_device_notify(struct notifier_block *me, unsigned long what, | |||
214 | 216 | ||
215 | switch (what) { | 217 | switch (what) { |
216 | case NETDEV_REGISTER: | 218 | case NETDEV_REGISTER: |
217 | pr_info("CAIF: %s():register %s\n", __func__, dev->name); | 219 | pr_info("register %s\n", dev->name); |
218 | caifd = caif_device_alloc(dev); | 220 | caifd = caif_device_alloc(dev); |
219 | if (caifd == NULL) | 221 | if (caifd == NULL) |
220 | break; | 222 | break; |
@@ -225,14 +227,13 @@ static int caif_device_notify(struct notifier_block *me, unsigned long what, | |||
225 | break; | 227 | break; |
226 | 228 | ||
227 | case NETDEV_UP: | 229 | case NETDEV_UP: |
228 | pr_info("CAIF: %s(): up %s\n", __func__, dev->name); | 230 | pr_info("up %s\n", dev->name); |
229 | caifd = caif_get(dev); | 231 | caifd = caif_get(dev); |
230 | if (caifd == NULL) | 232 | if (caifd == NULL) |
231 | break; | 233 | break; |
232 | caifdev = netdev_priv(dev); | 234 | caifdev = netdev_priv(dev); |
233 | if (atomic_read(&caifd->state) == NETDEV_UP) { | 235 | if (atomic_read(&caifd->state) == NETDEV_UP) { |
234 | pr_info("CAIF: %s():%s already up\n", | 236 | pr_info("%s already up\n", dev->name); |
235 | __func__, dev->name); | ||
236 | break; | 237 | break; |
237 | } | 238 | } |
238 | atomic_set(&caifd->state, what); | 239 | atomic_set(&caifd->state, what); |
@@ -273,7 +274,7 @@ static int caif_device_notify(struct notifier_block *me, unsigned long what, | |||
273 | caifd = caif_get(dev); | 274 | caifd = caif_get(dev); |
274 | if (caifd == NULL) | 275 | if (caifd == NULL) |
275 | break; | 276 | break; |
276 | pr_info("CAIF: %s():going down %s\n", __func__, dev->name); | 277 | pr_info("going down %s\n", dev->name); |
277 | 278 | ||
278 | if (atomic_read(&caifd->state) == NETDEV_GOING_DOWN || | 279 | if (atomic_read(&caifd->state) == NETDEV_GOING_DOWN || |
279 | atomic_read(&caifd->state) == NETDEV_DOWN) | 280 | atomic_read(&caifd->state) == NETDEV_DOWN) |
@@ -295,11 +296,10 @@ static int caif_device_notify(struct notifier_block *me, unsigned long what, | |||
295 | caifd = caif_get(dev); | 296 | caifd = caif_get(dev); |
296 | if (caifd == NULL) | 297 | if (caifd == NULL) |
297 | break; | 298 | break; |
298 | pr_info("CAIF: %s(): down %s\n", __func__, dev->name); | 299 | pr_info("down %s\n", dev->name); |
299 | if (atomic_read(&caifd->in_use)) | 300 | if (atomic_read(&caifd->in_use)) |
300 | pr_warning("CAIF: %s(): " | 301 | pr_warn("Unregistering an active CAIF device: %s\n", |
301 | "Unregistering an active CAIF device: %s\n", | 302 | dev->name); |
302 | __func__, dev->name); | ||
303 | cfcnfg_del_phy_layer(get_caif_conf(), &caifd->layer); | 303 | cfcnfg_del_phy_layer(get_caif_conf(), &caifd->layer); |
304 | dev_put(dev); | 304 | dev_put(dev); |
305 | atomic_set(&caifd->state, what); | 305 | atomic_set(&caifd->state, what); |
@@ -307,7 +307,7 @@ static int caif_device_notify(struct notifier_block *me, unsigned long what, | |||
307 | 307 | ||
308 | case NETDEV_UNREGISTER: | 308 | case NETDEV_UNREGISTER: |
309 | caifd = caif_get(dev); | 309 | caifd = caif_get(dev); |
310 | pr_info("CAIF: %s(): unregister %s\n", __func__, dev->name); | 310 | pr_info("unregister %s\n", dev->name); |
311 | atomic_set(&caifd->state, what); | 311 | atomic_set(&caifd->state, what); |
312 | caif_device_destroy(dev); | 312 | caif_device_destroy(dev); |
313 | break; | 313 | break; |
@@ -391,7 +391,7 @@ static int __init caif_device_init(void) | |||
391 | int result; | 391 | int result; |
392 | cfg = cfcnfg_create(); | 392 | cfg = cfcnfg_create(); |
393 | if (!cfg) { | 393 | if (!cfg) { |
394 | pr_warning("CAIF: %s(): can't create cfcnfg.\n", __func__); | 394 | pr_warn("can't create cfcnfg\n"); |
395 | goto err_cfcnfg_create_failed; | 395 | goto err_cfcnfg_create_failed; |
396 | } | 396 | } |
397 | result = register_pernet_device(&caif_net_ops); | 397 | result = register_pernet_device(&caif_net_ops); |