aboutsummaryrefslogtreecommitdiff
path: root/drivers/s390/net/claw.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/net/claw.c')
-rw-r--r--drivers/s390/net/claw.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/s390/net/claw.c b/drivers/s390/net/claw.c
index 6dd64d0c8d4..348bb7b8277 100644
--- a/drivers/s390/net/claw.c
+++ b/drivers/s390/net/claw.c
@@ -3912,6 +3912,7 @@ static int
add_channel(struct ccw_device *cdev,int i,struct claw_privbk *privptr)
{
struct chbk *p_ch;
+ struct ccw_dev_id dev_id;
#ifdef FUNCTRACE
printk(KERN_INFO "%s:%s Enter\n",cdev->dev.bus_id,__FUNCTION__);
@@ -3921,7 +3922,8 @@ add_channel(struct ccw_device *cdev,int i,struct claw_privbk *privptr)
p_ch = &privptr->channel[i];
p_ch->cdev = cdev;
snprintf(p_ch->id, CLAW_ID_SIZE, "cl-%s", cdev->dev.bus_id);
- sscanf(cdev->dev.bus_id+4,"%x",&p_ch->devno);
+ ccw_device_get_id(cdev, &dev_id);
+ p_ch->devno = dev_id.devno;
if ((p_ch->irb = kmalloc(sizeof (struct irb),GFP_KERNEL)) == NULL) {
printk(KERN_WARNING "%s Out of memory in %s for irb\n",
p_ch->id,__FUNCTION__);
@@ -3955,6 +3957,7 @@ claw_new_device(struct ccwgroup_device *cgdev)
struct claw_env *p_env;
struct net_device *dev;
int ret;
+ struct ccw_dev_id dev_id;
pr_debug("%s() called\n", __FUNCTION__);
printk(KERN_INFO "claw: add for %s\n",cgdev->cdev[READ]->dev.bus_id);
@@ -3965,10 +3968,10 @@ claw_new_device(struct ccwgroup_device *cgdev)
if (!privptr)
return -ENODEV;
p_env = privptr->p_env;
- sscanf(cgdev->cdev[READ]->dev.bus_id+4,"%x",
- &p_env->devno[READ]);
- sscanf(cgdev->cdev[WRITE]->dev.bus_id+4,"%x",
- &p_env->devno[WRITE]);
+ ccw_device_get_id(cgdev->cdev[READ], &dev_id);
+ p_env->devno[READ] = dev_id.devno;
+ ccw_device_get_id(cgdev->cdev[WRITE], &dev_id);
+ p_env->devno[WRITE] = dev_id.devno;
ret = add_channel(cgdev->cdev[0],0,privptr);
if (ret == 0)
ret = add_channel(cgdev->cdev[1],1,privptr);