Commit 837468d1 authored by Matthias Urlichs's avatar Matthias Urlichs Committed by Karsten Keil

mISDN: Use struct device name field

struct device already has a 'name' member, use it.
Signed-off-by: default avatarMatthias Urlichs <matthias@urlichs.de>
Signed-off-by: default avatarKarsten Keil <kkeil@suse.de>
parent 8b6015f7
...@@ -82,12 +82,12 @@ mISDN_register_device(struct mISDNdevice *dev, char *name) ...@@ -82,12 +82,12 @@ mISDN_register_device(struct mISDNdevice *dev, char *name)
if (dev->id < 0) if (dev->id < 0)
return -EBUSY; return -EBUSY;
if (name && name[0]) if (name && name[0])
strcpy(dev->name, name); dev_set_name(&dev->dev, "%s", name);
else else
sprintf(dev->name, "mISDN%d", dev->id); dev_set_name(&dev->dev, "mISDN%d", dev->id);
if (debug & DEBUG_CORE) if (debug & DEBUG_CORE)
printk(KERN_DEBUG "mISDN_register %s %d\n", printk(KERN_DEBUG "mISDN_register %s %d\n",
dev->name, dev->id); dev_name(&dev->dev), dev->id);
err = create_stack(dev); err = create_stack(dev);
if (err) if (err)
return err; return err;
...@@ -104,7 +104,7 @@ mISDN_unregister_device(struct mISDNdevice *dev) { ...@@ -104,7 +104,7 @@ mISDN_unregister_device(struct mISDNdevice *dev) {
if (debug & DEBUG_CORE) if (debug & DEBUG_CORE)
printk(KERN_DEBUG "mISDN_unregister %s %d\n", printk(KERN_DEBUG "mISDN_unregister %s %d\n",
dev->name, dev->id); dev_name(&dev->dev), dev->id);
write_lock_irqsave(&device_lock, flags); write_lock_irqsave(&device_lock, flags);
list_del(&dev->D.list); list_del(&dev->D.list);
write_unlock_irqrestore(&device_lock, flags); write_unlock_irqrestore(&device_lock, flags);
......
...@@ -101,7 +101,7 @@ l1m_debug(struct FsmInst *fi, char *fmt, ...) ...@@ -101,7 +101,7 @@ l1m_debug(struct FsmInst *fi, char *fmt, ...)
va_list va; va_list va;
va_start(va, fmt); va_start(va, fmt);
printk(KERN_DEBUG "%s: ", l1->dch->dev.name); printk(KERN_DEBUG "%s: ", dev_name(&l1->dch->dev.dev));
vprintk(fmt, va); vprintk(fmt, va);
printk("\n"); printk("\n");
va_end(va); va_end(va);
......
...@@ -381,7 +381,7 @@ data_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) ...@@ -381,7 +381,7 @@ data_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
memcpy(di.channelmap, dev->channelmap, memcpy(di.channelmap, dev->channelmap,
sizeof(di.channelmap)); sizeof(di.channelmap));
di.nrbchan = dev->nrbchan; di.nrbchan = dev->nrbchan;
strcpy(di.name, dev->name); strcpy(di.name, dev_name(&dev->dev));
if (copy_to_user((void __user *)arg, &di, sizeof(di))) if (copy_to_user((void __user *)arg, &di, sizeof(di)))
err = -EFAULT; err = -EFAULT;
} else } else
...@@ -639,7 +639,7 @@ base_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) ...@@ -639,7 +639,7 @@ base_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
memcpy(di.channelmap, dev->channelmap, memcpy(di.channelmap, dev->channelmap,
sizeof(di.channelmap)); sizeof(di.channelmap));
di.nrbchan = dev->nrbchan; di.nrbchan = dev->nrbchan;
strcpy(di.name, dev->name); strcpy(di.name, dev_name(&dev->dev));
if (copy_to_user((void __user *)arg, &di, sizeof(di))) if (copy_to_user((void __user *)arg, &di, sizeof(di)))
err = -EFAULT; err = -EFAULT;
} else } else
...@@ -655,7 +655,7 @@ base_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) ...@@ -655,7 +655,7 @@ base_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
} }
dev = get_mdevice(dn.id); dev = get_mdevice(dn.id);
if (dev) if (dev)
strlcpy(dev->name, dn.name, MISDN_MAX_IDLEN); err = device_rename(&dev->dev, dn.name);
else else
err = -ENODEV; err = -ENODEV;
} }
......
...@@ -172,7 +172,8 @@ send_msg_to_layer(struct mISDNstack *st, struct sk_buff *skb) ...@@ -172,7 +172,8 @@ send_msg_to_layer(struct mISDNstack *st, struct sk_buff *skb)
else else
printk(KERN_WARNING printk(KERN_WARNING
"%s: dev(%s) prim(%x) id(%x) no channel\n", "%s: dev(%s) prim(%x) id(%x) no channel\n",
__func__, st->dev->name, hh->prim, hh->id); __func__, dev_name(&st->dev->dev), hh->prim,
hh->id);
} else if (lm == 0x8) { } else if (lm == 0x8) {
WARN_ON(lm == 0x8); WARN_ON(lm == 0x8);
ch = get_channel4id(st, hh->id); ch = get_channel4id(st, hh->id);
...@@ -181,11 +182,12 @@ send_msg_to_layer(struct mISDNstack *st, struct sk_buff *skb) ...@@ -181,11 +182,12 @@ send_msg_to_layer(struct mISDNstack *st, struct sk_buff *skb)
else else
printk(KERN_WARNING printk(KERN_WARNING
"%s: dev(%s) prim(%x) id(%x) no channel\n", "%s: dev(%s) prim(%x) id(%x) no channel\n",
__func__, st->dev->name, hh->prim, hh->id); __func__, dev_name(&st->dev->dev), hh->prim,
hh->id);
} else { } else {
/* broadcast not handled yet */ /* broadcast not handled yet */
printk(KERN_WARNING "%s: dev(%s) prim %x not delivered\n", printk(KERN_WARNING "%s: dev(%s) prim %x not delivered\n",
__func__, st->dev->name, hh->prim); __func__, dev_name(&st->dev->dev), hh->prim);
} }
return -ESRCH; return -ESRCH;
} }
...@@ -209,7 +211,8 @@ mISDNStackd(void *data) ...@@ -209,7 +211,8 @@ mISDNStackd(void *data)
unlock_kernel(); unlock_kernel();
#endif #endif
if (*debug & DEBUG_MSG_THREAD) if (*debug & DEBUG_MSG_THREAD)
printk(KERN_DEBUG "mISDNStackd %s started\n", st->dev->name); printk(KERN_DEBUG "mISDNStackd %s started\n",
dev_name(&st->dev->dev));
if (st->notify != NULL) { if (st->notify != NULL) {
complete(st->notify); complete(st->notify);
...@@ -245,7 +248,7 @@ mISDNStackd(void *data) ...@@ -245,7 +248,7 @@ mISDNStackd(void *data)
printk(KERN_DEBUG printk(KERN_DEBUG
"%s: %s prim(%x) id(%x) " "%s: %s prim(%x) id(%x) "
"send call(%d)\n", "send call(%d)\n",
__func__, st->dev->name, __func__, dev_name(&st->dev->dev),
mISDN_HEAD_PRIM(skb), mISDN_HEAD_PRIM(skb),
mISDN_HEAD_ID(skb), err); mISDN_HEAD_ID(skb), err);
dev_kfree_skb(skb); dev_kfree_skb(skb);
...@@ -288,7 +291,7 @@ mISDNStackd(void *data) ...@@ -288,7 +291,7 @@ mISDNStackd(void *data)
mISDN_STACK_ACTION_MASK)); mISDN_STACK_ACTION_MASK));
if (*debug & DEBUG_MSG_THREAD) if (*debug & DEBUG_MSG_THREAD)
printk(KERN_DEBUG "%s: %s wake status %08lx\n", printk(KERN_DEBUG "%s: %s wake status %08lx\n",
__func__, st->dev->name, st->status); __func__, dev_name(&st->dev->dev), st->status);
test_and_set_bit(mISDN_STACK_ACTIVE, &st->status); test_and_set_bit(mISDN_STACK_ACTIVE, &st->status);
test_and_clear_bit(mISDN_STACK_WAKEUP, &st->status); test_and_clear_bit(mISDN_STACK_WAKEUP, &st->status);
...@@ -303,15 +306,16 @@ mISDNStackd(void *data) ...@@ -303,15 +306,16 @@ mISDNStackd(void *data)
#ifdef MISDN_MSG_STATS #ifdef MISDN_MSG_STATS
printk(KERN_DEBUG "mISDNStackd daemon for %s proceed %d " printk(KERN_DEBUG "mISDNStackd daemon for %s proceed %d "
"msg %d sleep %d stopped\n", "msg %d sleep %d stopped\n",
st->dev->name, st->msg_cnt, st->sleep_cnt, st->stopped_cnt); dev_name(&st->dev->dev), st->msg_cnt, st->sleep_cnt,
st->stopped_cnt);
printk(KERN_DEBUG printk(KERN_DEBUG
"mISDNStackd daemon for %s utime(%ld) stime(%ld)\n", "mISDNStackd daemon for %s utime(%ld) stime(%ld)\n",
st->dev->name, st->thread->utime, st->thread->stime); dev_name(&st->dev->dev), st->thread->utime, st->thread->stime);
printk(KERN_DEBUG printk(KERN_DEBUG
"mISDNStackd daemon for %s nvcsw(%ld) nivcsw(%ld)\n", "mISDNStackd daemon for %s nvcsw(%ld) nivcsw(%ld)\n",
st->dev->name, st->thread->nvcsw, st->thread->nivcsw); dev_name(&st->dev->dev), st->thread->nvcsw, st->thread->nivcsw);
printk(KERN_DEBUG "mISDNStackd daemon for %s killed now\n", printk(KERN_DEBUG "mISDNStackd daemon for %s killed now\n",
st->dev->name); dev_name(&st->dev->dev));
#endif #endif
test_and_set_bit(mISDN_STACK_KILLED, &st->status); test_and_set_bit(mISDN_STACK_KILLED, &st->status);
test_and_clear_bit(mISDN_STACK_RUNNING, &st->status); test_and_clear_bit(mISDN_STACK_RUNNING, &st->status);
...@@ -401,15 +405,16 @@ create_stack(struct mISDNdevice *dev) ...@@ -401,15 +405,16 @@ create_stack(struct mISDNdevice *dev)
newst->own.send = mISDN_queue_message; newst->own.send = mISDN_queue_message;
newst->own.recv = mISDN_queue_message; newst->own.recv = mISDN_queue_message;
if (*debug & DEBUG_CORE_FUNC) if (*debug & DEBUG_CORE_FUNC)
printk(KERN_DEBUG "%s: st(%s)\n", __func__, newst->dev->name); printk(KERN_DEBUG "%s: st(%s)\n", __func__,
dev_name(&newst->dev->dev));
newst->notify = &done; newst->notify = &done;
newst->thread = kthread_run(mISDNStackd, (void *)newst, "mISDN_%s", newst->thread = kthread_run(mISDNStackd, (void *)newst, "mISDN_%s",
newst->dev->name); dev_name(&newst->dev->dev));
if (IS_ERR(newst->thread)) { if (IS_ERR(newst->thread)) {
err = PTR_ERR(newst->thread); err = PTR_ERR(newst->thread);
printk(KERN_ERR printk(KERN_ERR
"mISDN:cannot create kernel thread for %s (%d)\n", "mISDN:cannot create kernel thread for %s (%d)\n",
newst->dev->name, err); dev_name(&newst->dev->dev), err);
delete_teimanager(dev->teimgr); delete_teimanager(dev->teimgr);
kfree(newst); kfree(newst);
} else } else
...@@ -428,8 +433,8 @@ connect_layer1(struct mISDNdevice *dev, struct mISDNchannel *ch, ...@@ -428,8 +433,8 @@ connect_layer1(struct mISDNdevice *dev, struct mISDNchannel *ch,
if (*debug & DEBUG_CORE_FUNC) if (*debug & DEBUG_CORE_FUNC)
printk(KERN_DEBUG "%s: %s proto(%x) adr(%d %d %d %d)\n", printk(KERN_DEBUG "%s: %s proto(%x) adr(%d %d %d %d)\n",
__func__, dev->name, protocol, adr->dev, adr->channel, __func__, dev_name(&dev->dev), protocol, adr->dev,
adr->sapi, adr->tei); adr->channel, adr->sapi, adr->tei);
switch (protocol) { switch (protocol) {
case ISDN_P_NT_S0: case ISDN_P_NT_S0:
case ISDN_P_NT_E1: case ISDN_P_NT_E1:
...@@ -473,7 +478,7 @@ connect_Bstack(struct mISDNdevice *dev, struct mISDNchannel *ch, ...@@ -473,7 +478,7 @@ connect_Bstack(struct mISDNdevice *dev, struct mISDNchannel *ch,
if (*debug & DEBUG_CORE_FUNC) if (*debug & DEBUG_CORE_FUNC)
printk(KERN_DEBUG "%s: %s proto(%x) adr(%d %d %d %d)\n", printk(KERN_DEBUG "%s: %s proto(%x) adr(%d %d %d %d)\n",
__func__, dev->name, protocol, __func__, dev_name(&dev->dev), protocol,
adr->dev, adr->channel, adr->sapi, adr->dev, adr->channel, adr->sapi,
adr->tei); adr->tei);
ch->st = dev->D.st; ch->st = dev->D.st;
...@@ -529,7 +534,7 @@ create_l2entity(struct mISDNdevice *dev, struct mISDNchannel *ch, ...@@ -529,7 +534,7 @@ create_l2entity(struct mISDNdevice *dev, struct mISDNchannel *ch,
if (*debug & DEBUG_CORE_FUNC) if (*debug & DEBUG_CORE_FUNC)
printk(KERN_DEBUG "%s: %s proto(%x) adr(%d %d %d %d)\n", printk(KERN_DEBUG "%s: %s proto(%x) adr(%d %d %d %d)\n",
__func__, dev->name, protocol, __func__, dev_name(&dev->dev), protocol,
adr->dev, adr->channel, adr->sapi, adr->dev, adr->channel, adr->sapi,
adr->tei); adr->tei);
rq.protocol = ISDN_P_TE_S0; rq.protocol = ISDN_P_TE_S0;
...@@ -590,7 +595,7 @@ delete_channel(struct mISDNchannel *ch) ...@@ -590,7 +595,7 @@ delete_channel(struct mISDNchannel *ch)
} }
if (*debug & DEBUG_CORE_FUNC) if (*debug & DEBUG_CORE_FUNC)
printk(KERN_DEBUG "%s: st(%s) protocol(%x)\n", __func__, printk(KERN_DEBUG "%s: st(%s) protocol(%x)\n", __func__,
ch->st->dev->name, ch->protocol); dev_name(&ch->st->dev->dev), ch->protocol);
if (ch->protocol >= ISDN_P_B_START) { if (ch->protocol >= ISDN_P_B_START) {
if (ch->peer) { if (ch->peer) {
ch->peer->ctrl(ch->peer, CLOSE_CHANNEL, NULL); ch->peer->ctrl(ch->peer, CLOSE_CHANNEL, NULL);
...@@ -643,7 +648,7 @@ delete_stack(struct mISDNdevice *dev) ...@@ -643,7 +648,7 @@ delete_stack(struct mISDNdevice *dev)
if (*debug & DEBUG_CORE_FUNC) if (*debug & DEBUG_CORE_FUNC)
printk(KERN_DEBUG "%s: st(%s)\n", __func__, printk(KERN_DEBUG "%s: st(%s)\n", __func__,
st->dev->name); dev_name(&st->dev->dev));
if (dev->teimgr) if (dev->teimgr)
delete_teimanager(dev->teimgr); delete_teimanager(dev->teimgr);
if (st->thread) { if (st->thread) {
......
...@@ -968,9 +968,9 @@ create_teimgr(struct manager *mgr, struct channel_req *crq) ...@@ -968,9 +968,9 @@ create_teimgr(struct manager *mgr, struct channel_req *crq)
if (*debug & DEBUG_L2_TEI) if (*debug & DEBUG_L2_TEI)
printk(KERN_DEBUG "%s: %s proto(%x) adr(%d %d %d %d)\n", printk(KERN_DEBUG "%s: %s proto(%x) adr(%d %d %d %d)\n",
__func__, mgr->ch.st->dev->name, crq->protocol, __func__, dev_name(&mgr->ch.st->dev->dev),
crq->adr.dev, crq->adr.channel, crq->adr.sapi, crq->protocol, crq->adr.dev, crq->adr.channel,
crq->adr.tei); crq->adr.sapi, crq->adr.tei);
if (crq->adr.sapi != 0) /* not supported yet */ if (crq->adr.sapi != 0) /* not supported yet */
return -EINVAL; return -EINVAL;
if (crq->adr.tei > GROUP_TEI) if (crq->adr.tei > GROUP_TEI)
......
...@@ -431,7 +431,6 @@ struct mISDN_sock { ...@@ -431,7 +431,6 @@ struct mISDN_sock {
struct mISDNdevice { struct mISDNdevice {
struct mISDNchannel D; struct mISDNchannel D;
u_int id; u_int id;
char name[MISDN_MAX_IDLEN];
u_int Dprotocols; u_int Dprotocols;
u_int Bprotocols; u_int Bprotocols;
u_int nrbchan; u_int nrbchan;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment