aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn
diff options
context:
space:
mode:
authorMatthias Urlichs <smurf@smurf.noris.de>2008-08-15 18:04:33 -0400
committerKarsten Keil <kkeil@suse.de>2009-01-09 16:44:24 -0500
commit837468d135dcc49cdabc9fa92fc9550479f60704 (patch)
tree354aace7616729beac5ae52165b9470651145193 /drivers/isdn
parent8b6015f736125050722dbe59c4f943e78cd626f0 (diff)
mISDN: Use struct device name field
struct device already has a 'name' member, use it. Signed-off-by: Matthias Urlichs <matthias@urlichs.de> Signed-off-by: Karsten Keil <kkeil@suse.de>
Diffstat (limited to 'drivers/isdn')
-rw-r--r--drivers/isdn/mISDN/core.c8
-rw-r--r--drivers/isdn/mISDN/layer1.c2
-rw-r--r--drivers/isdn/mISDN/socket.c6
-rw-r--r--drivers/isdn/mISDN/stack.c43
-rw-r--r--drivers/isdn/mISDN/tei.c6
5 files changed, 35 insertions, 30 deletions
diff --git a/drivers/isdn/mISDN/core.c b/drivers/isdn/mISDN/core.c
index 751665c448d0..43fd97b0fe42 100644
--- a/drivers/isdn/mISDN/core.c
+++ b/drivers/isdn/mISDN/core.c
@@ -82,12 +82,12 @@ mISDN_register_device(struct mISDNdevice *dev, char *name)
82 if (dev->id < 0) 82 if (dev->id < 0)
83 return -EBUSY; 83 return -EBUSY;
84 if (name && name[0]) 84 if (name && name[0])
85 strcpy(dev->name, name); 85 dev_set_name(&dev->dev, "%s", name);
86 else 86 else
87 sprintf(dev->name, "mISDN%d", dev->id); 87 dev_set_name(&dev->dev, "mISDN%d", dev->id);
88 if (debug & DEBUG_CORE) 88 if (debug & DEBUG_CORE)
89 printk(KERN_DEBUG "mISDN_register %s %d\n", 89 printk(KERN_DEBUG "mISDN_register %s %d\n",
90 dev->name, dev->id); 90 dev_name(&dev->dev), dev->id);
91 err = create_stack(dev); 91 err = create_stack(dev);
92 if (err) 92 if (err)
93 return err; 93 return err;
@@ -104,7 +104,7 @@ mISDN_unregister_device(struct mISDNdevice *dev) {
104 104
105 if (debug & DEBUG_CORE) 105 if (debug & DEBUG_CORE)
106 printk(KERN_DEBUG "mISDN_unregister %s %d\n", 106 printk(KERN_DEBUG "mISDN_unregister %s %d\n",
107 dev->name, dev->id); 107 dev_name(&dev->dev), dev->id);
108 write_lock_irqsave(&device_lock, flags); 108 write_lock_irqsave(&device_lock, flags);
109 list_del(&dev->D.list); 109 list_del(&dev->D.list);
110 write_unlock_irqrestore(&device_lock, flags); 110 write_unlock_irqrestore(&device_lock, flags);
diff --git a/drivers/isdn/mISDN/layer1.c b/drivers/isdn/mISDN/layer1.c
index b73e952d12cf..e826eeb1ecec 100644
--- a/drivers/isdn/mISDN/layer1.c
+++ b/drivers/isdn/mISDN/layer1.c
@@ -101,7 +101,7 @@ l1m_debug(struct FsmInst *fi, char *fmt, ...)
101 va_list va; 101 va_list va;
102 102
103 va_start(va, fmt); 103 va_start(va, fmt);
104 printk(KERN_DEBUG "%s: ", l1->dch->dev.name); 104 printk(KERN_DEBUG "%s: ", dev_name(&l1->dch->dev.dev));
105 vprintk(fmt, va); 105 vprintk(fmt, va);
106 printk("\n"); 106 printk("\n");
107 va_end(va); 107 va_end(va);
diff --git a/drivers/isdn/mISDN/socket.c b/drivers/isdn/mISDN/socket.c
index 98fa6c4a4bd6..2f6d6e88ff2c 100644
--- a/drivers/isdn/mISDN/socket.c
+++ b/drivers/isdn/mISDN/socket.c
@@ -381,7 +381,7 @@ data_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
381 memcpy(di.channelmap, dev->channelmap, 381 memcpy(di.channelmap, dev->channelmap,
382 sizeof(di.channelmap)); 382 sizeof(di.channelmap));
383 di.nrbchan = dev->nrbchan; 383 di.nrbchan = dev->nrbchan;
384 strcpy(di.name, dev->name); 384 strcpy(di.name, dev_name(&dev->dev));
385 if (copy_to_user((void __user *)arg, &di, sizeof(di))) 385 if (copy_to_user((void __user *)arg, &di, sizeof(di)))
386 err = -EFAULT; 386 err = -EFAULT;
387 } else 387 } else
@@ -639,7 +639,7 @@ base_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
639 memcpy(di.channelmap, dev->channelmap, 639 memcpy(di.channelmap, dev->channelmap,
640 sizeof(di.channelmap)); 640 sizeof(di.channelmap));
641 di.nrbchan = dev->nrbchan; 641 di.nrbchan = dev->nrbchan;
642 strcpy(di.name, dev->name); 642 strcpy(di.name, dev_name(&dev->dev));
643 if (copy_to_user((void __user *)arg, &di, sizeof(di))) 643 if (copy_to_user((void __user *)arg, &di, sizeof(di)))
644 err = -EFAULT; 644 err = -EFAULT;
645 } else 645 } else
@@ -655,7 +655,7 @@ base_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
655 } 655 }
656 dev = get_mdevice(dn.id); 656 dev = get_mdevice(dn.id);
657 if (dev) 657 if (dev)
658 strlcpy(dev->name, dn.name, MISDN_MAX_IDLEN); 658 err = device_rename(&dev->dev, dn.name);
659 else 659 else
660 err = -ENODEV; 660 err = -ENODEV;
661 } 661 }
diff --git a/drivers/isdn/mISDN/stack.c b/drivers/isdn/mISDN/stack.c
index d55b14ae4e99..9b9fab47cb2b 100644
--- a/drivers/isdn/mISDN/stack.c
+++ b/drivers/isdn/mISDN/stack.c
@@ -172,7 +172,8 @@ send_msg_to_layer(struct mISDNstack *st, struct sk_buff *skb)
172 else 172 else
173 printk(KERN_WARNING 173 printk(KERN_WARNING
174 "%s: dev(%s) prim(%x) id(%x) no channel\n", 174 "%s: dev(%s) prim(%x) id(%x) no channel\n",
175 __func__, st->dev->name, hh->prim, hh->id); 175 __func__, dev_name(&st->dev->dev), hh->prim,
176 hh->id);
176 } else if (lm == 0x8) { 177 } else if (lm == 0x8) {
177 WARN_ON(lm == 0x8); 178 WARN_ON(lm == 0x8);
178 ch = get_channel4id(st, hh->id); 179 ch = get_channel4id(st, hh->id);
@@ -181,11 +182,12 @@ send_msg_to_layer(struct mISDNstack *st, struct sk_buff *skb)
181 else 182 else
182 printk(KERN_WARNING 183 printk(KERN_WARNING
183 "%s: dev(%s) prim(%x) id(%x) no channel\n", 184 "%s: dev(%s) prim(%x) id(%x) no channel\n",
184 __func__, st->dev->name, hh->prim, hh->id); 185 __func__, dev_name(&st->dev->dev), hh->prim,
186 hh->id);
185 } else { 187 } else {
186 /* broadcast not handled yet */ 188 /* broadcast not handled yet */
187 printk(KERN_WARNING "%s: dev(%s) prim %x not delivered\n", 189 printk(KERN_WARNING "%s: dev(%s) prim %x not delivered\n",
188 __func__, st->dev->name, hh->prim); 190 __func__, dev_name(&st->dev->dev), hh->prim);
189 } 191 }
190 return -ESRCH; 192 return -ESRCH;
191} 193}
@@ -209,7 +211,8 @@ mISDNStackd(void *data)
209 unlock_kernel(); 211 unlock_kernel();
210#endif 212#endif
211 if (*debug & DEBUG_MSG_THREAD) 213 if (*debug & DEBUG_MSG_THREAD)
212 printk(KERN_DEBUG "mISDNStackd %s started\n", st->dev->name); 214 printk(KERN_DEBUG "mISDNStackd %s started\n",
215 dev_name(&st->dev->dev));
213 216
214 if (st->notify != NULL) { 217 if (st->notify != NULL) {
215 complete(st->notify); 218 complete(st->notify);
@@ -245,7 +248,7 @@ mISDNStackd(void *data)
245 printk(KERN_DEBUG 248 printk(KERN_DEBUG
246 "%s: %s prim(%x) id(%x) " 249 "%s: %s prim(%x) id(%x) "
247 "send call(%d)\n", 250 "send call(%d)\n",
248 __func__, st->dev->name, 251 __func__, dev_name(&st->dev->dev),
249 mISDN_HEAD_PRIM(skb), 252 mISDN_HEAD_PRIM(skb),
250 mISDN_HEAD_ID(skb), err); 253 mISDN_HEAD_ID(skb), err);
251 dev_kfree_skb(skb); 254 dev_kfree_skb(skb);
@@ -288,7 +291,7 @@ mISDNStackd(void *data)
288 mISDN_STACK_ACTION_MASK)); 291 mISDN_STACK_ACTION_MASK));
289 if (*debug & DEBUG_MSG_THREAD) 292 if (*debug & DEBUG_MSG_THREAD)
290 printk(KERN_DEBUG "%s: %s wake status %08lx\n", 293 printk(KERN_DEBUG "%s: %s wake status %08lx\n",
291 __func__, st->dev->name, st->status); 294 __func__, dev_name(&st->dev->dev), st->status);
292 test_and_set_bit(mISDN_STACK_ACTIVE, &st->status); 295 test_and_set_bit(mISDN_STACK_ACTIVE, &st->status);
293 296
294 test_and_clear_bit(mISDN_STACK_WAKEUP, &st->status); 297 test_and_clear_bit(mISDN_STACK_WAKEUP, &st->status);
@@ -303,15 +306,16 @@ mISDNStackd(void *data)
303#ifdef MISDN_MSG_STATS 306#ifdef MISDN_MSG_STATS
304 printk(KERN_DEBUG "mISDNStackd daemon for %s proceed %d " 307 printk(KERN_DEBUG "mISDNStackd daemon for %s proceed %d "
305 "msg %d sleep %d stopped\n", 308 "msg %d sleep %d stopped\n",
306 st->dev->name, st->msg_cnt, st->sleep_cnt, st->stopped_cnt); 309 dev_name(&st->dev->dev), st->msg_cnt, st->sleep_cnt,
310 st->stopped_cnt);
307 printk(KERN_DEBUG 311 printk(KERN_DEBUG
308 "mISDNStackd daemon for %s utime(%ld) stime(%ld)\n", 312 "mISDNStackd daemon for %s utime(%ld) stime(%ld)\n",
309 st->dev->name, st->thread->utime, st->thread->stime); 313 dev_name(&st->dev->dev), st->thread->utime, st->thread->stime);
310 printk(KERN_DEBUG 314 printk(KERN_DEBUG
311 "mISDNStackd daemon for %s nvcsw(%ld) nivcsw(%ld)\n", 315 "mISDNStackd daemon for %s nvcsw(%ld) nivcsw(%ld)\n",
312 st->dev->name, st->thread->nvcsw, st->thread->nivcsw); 316 dev_name(&st->dev->dev), st->thread->nvcsw, st->thread->nivcsw);
313 printk(KERN_DEBUG "mISDNStackd daemon for %s killed now\n", 317 printk(KERN_DEBUG "mISDNStackd daemon for %s killed now\n",
314 st->dev->name); 318 dev_name(&st->dev->dev));
315#endif 319#endif
316 test_and_set_bit(mISDN_STACK_KILLED, &st->status); 320 test_and_set_bit(mISDN_STACK_KILLED, &st->status);
317 test_and_clear_bit(mISDN_STACK_RUNNING, &st->status); 321 test_and_clear_bit(mISDN_STACK_RUNNING, &st->status);
@@ -401,15 +405,16 @@ create_stack(struct mISDNdevice *dev)
401 newst->own.send = mISDN_queue_message; 405 newst->own.send = mISDN_queue_message;
402 newst->own.recv = mISDN_queue_message; 406 newst->own.recv = mISDN_queue_message;
403 if (*debug & DEBUG_CORE_FUNC) 407 if (*debug & DEBUG_CORE_FUNC)
404 printk(KERN_DEBUG "%s: st(%s)\n", __func__, newst->dev->name); 408 printk(KERN_DEBUG "%s: st(%s)\n", __func__,
409 dev_name(&newst->dev->dev));
405 newst->notify = &done; 410 newst->notify = &done;
406 newst->thread = kthread_run(mISDNStackd, (void *)newst, "mISDN_%s", 411 newst->thread = kthread_run(mISDNStackd, (void *)newst, "mISDN_%s",
407 newst->dev->name); 412 dev_name(&newst->dev->dev));
408 if (IS_ERR(newst->thread)) { 413 if (IS_ERR(newst->thread)) {
409 err = PTR_ERR(newst->thread); 414 err = PTR_ERR(newst->thread);
410 printk(KERN_ERR 415 printk(KERN_ERR
411 "mISDN:cannot create kernel thread for %s (%d)\n", 416 "mISDN:cannot create kernel thread for %s (%d)\n",
412 newst->dev->name, err); 417 dev_name(&newst->dev->dev), err);
413 delete_teimanager(dev->teimgr); 418 delete_teimanager(dev->teimgr);
414 kfree(newst); 419 kfree(newst);
415 } else 420 } else
@@ -428,8 +433,8 @@ connect_layer1(struct mISDNdevice *dev, struct mISDNchannel *ch,
428 433
429 if (*debug & DEBUG_CORE_FUNC) 434 if (*debug & DEBUG_CORE_FUNC)
430 printk(KERN_DEBUG "%s: %s proto(%x) adr(%d %d %d %d)\n", 435 printk(KERN_DEBUG "%s: %s proto(%x) adr(%d %d %d %d)\n",
431 __func__, dev->name, protocol, adr->dev, adr->channel, 436 __func__, dev_name(&dev->dev), protocol, adr->dev,
432 adr->sapi, adr->tei); 437 adr->channel, adr->sapi, adr->tei);
433 switch (protocol) { 438 switch (protocol) {
434 case ISDN_P_NT_S0: 439 case ISDN_P_NT_S0:
435 case ISDN_P_NT_E1: 440 case ISDN_P_NT_E1:
@@ -473,7 +478,7 @@ connect_Bstack(struct mISDNdevice *dev, struct mISDNchannel *ch,
473 478
474 if (*debug & DEBUG_CORE_FUNC) 479 if (*debug & DEBUG_CORE_FUNC)
475 printk(KERN_DEBUG "%s: %s proto(%x) adr(%d %d %d %d)\n", 480 printk(KERN_DEBUG "%s: %s proto(%x) adr(%d %d %d %d)\n",
476 __func__, dev->name, protocol, 481 __func__, dev_name(&dev->dev), protocol,
477 adr->dev, adr->channel, adr->sapi, 482 adr->dev, adr->channel, adr->sapi,
478 adr->tei); 483 adr->tei);
479 ch->st = dev->D.st; 484 ch->st = dev->D.st;
@@ -529,7 +534,7 @@ create_l2entity(struct mISDNdevice *dev, struct mISDNchannel *ch,
529 534
530 if (*debug & DEBUG_CORE_FUNC) 535 if (*debug & DEBUG_CORE_FUNC)
531 printk(KERN_DEBUG "%s: %s proto(%x) adr(%d %d %d %d)\n", 536 printk(KERN_DEBUG "%s: %s proto(%x) adr(%d %d %d %d)\n",
532 __func__, dev->name, protocol, 537 __func__, dev_name(&dev->dev), protocol,
533 adr->dev, adr->channel, adr->sapi, 538 adr->dev, adr->channel, adr->sapi,
534 adr->tei); 539 adr->tei);
535 rq.protocol = ISDN_P_TE_S0; 540 rq.protocol = ISDN_P_TE_S0;
@@ -590,7 +595,7 @@ delete_channel(struct mISDNchannel *ch)
590 } 595 }
591 if (*debug & DEBUG_CORE_FUNC) 596 if (*debug & DEBUG_CORE_FUNC)
592 printk(KERN_DEBUG "%s: st(%s) protocol(%x)\n", __func__, 597 printk(KERN_DEBUG "%s: st(%s) protocol(%x)\n", __func__,
593 ch->st->dev->name, ch->protocol); 598 dev_name(&ch->st->dev->dev), ch->protocol);
594 if (ch->protocol >= ISDN_P_B_START) { 599 if (ch->protocol >= ISDN_P_B_START) {
595 if (ch->peer) { 600 if (ch->peer) {
596 ch->peer->ctrl(ch->peer, CLOSE_CHANNEL, NULL); 601 ch->peer->ctrl(ch->peer, CLOSE_CHANNEL, NULL);
@@ -643,7 +648,7 @@ delete_stack(struct mISDNdevice *dev)
643 648
644 if (*debug & DEBUG_CORE_FUNC) 649 if (*debug & DEBUG_CORE_FUNC)
645 printk(KERN_DEBUG "%s: st(%s)\n", __func__, 650 printk(KERN_DEBUG "%s: st(%s)\n", __func__,
646 st->dev->name); 651 dev_name(&st->dev->dev));
647 if (dev->teimgr) 652 if (dev->teimgr)
648 delete_teimanager(dev->teimgr); 653 delete_teimanager(dev->teimgr);
649 if (st->thread) { 654 if (st->thread) {
diff --git a/drivers/isdn/mISDN/tei.c b/drivers/isdn/mISDN/tei.c
index 5c43d19e7c11..b452dead8fd0 100644
--- a/drivers/isdn/mISDN/tei.c
+++ b/drivers/isdn/mISDN/tei.c
@@ -968,9 +968,9 @@ create_teimgr(struct manager *mgr, struct channel_req *crq)
968 968
969 if (*debug & DEBUG_L2_TEI) 969 if (*debug & DEBUG_L2_TEI)
970 printk(KERN_DEBUG "%s: %s proto(%x) adr(%d %d %d %d)\n", 970 printk(KERN_DEBUG "%s: %s proto(%x) adr(%d %d %d %d)\n",
971 __func__, mgr->ch.st->dev->name, crq->protocol, 971 __func__, dev_name(&mgr->ch.st->dev->dev),
972 crq->adr.dev, crq->adr.channel, crq->adr.sapi, 972 crq->protocol, crq->adr.dev, crq->adr.channel,
973 crq->adr.tei); 973 crq->adr.sapi, crq->adr.tei);
974 if (crq->adr.sapi != 0) /* not supported yet */ 974 if (crq->adr.sapi != 0) /* not supported yet */
975 return -EINVAL; 975 return -EINVAL;
976 if (crq->adr.tei > GROUP_TEI) 976 if (crq->adr.tei > GROUP_TEI)