diff options
author | Cornelia Huck <cornelia.huck@de.ibm.com> | 2007-06-20 07:00:20 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-06-20 19:12:42 -0400 |
commit | dc5bc0cabd1003b4fa358f0d54dfdc46585efb57 (patch) | |
tree | 2d65a1411703cfcc10c54788713935c44a505a43 /drivers/s390 | |
parent | cd3e76ebcb41c48ef6e706006b793d45030bae75 (diff) |
s390: Use ccw_device_get_id() in qeth/claw drivers
Use ccw_device_get_id() to get a device number
instead of parsing the ccw device's bus id.
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Frank Pavlic <fpavlic@de.ibm.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/s390')
-rw-r--r-- | drivers/s390/net/claw.c | 13 | ||||
-rw-r--r-- | drivers/s390/net/qeth_main.c | 12 |
2 files changed, 11 insertions, 14 deletions
diff --git a/drivers/s390/net/claw.c b/drivers/s390/net/claw.c index 6dd64d0c8d45..348bb7b82771 100644 --- a/drivers/s390/net/claw.c +++ b/drivers/s390/net/claw.c | |||
@@ -3912,6 +3912,7 @@ static int | |||
3912 | add_channel(struct ccw_device *cdev,int i,struct claw_privbk *privptr) | 3912 | add_channel(struct ccw_device *cdev,int i,struct claw_privbk *privptr) |
3913 | { | 3913 | { |
3914 | struct chbk *p_ch; | 3914 | struct chbk *p_ch; |
3915 | struct ccw_dev_id dev_id; | ||
3915 | 3916 | ||
3916 | #ifdef FUNCTRACE | 3917 | #ifdef FUNCTRACE |
3917 | printk(KERN_INFO "%s:%s Enter\n",cdev->dev.bus_id,__FUNCTION__); | 3918 | 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) | |||
3921 | p_ch = &privptr->channel[i]; | 3922 | p_ch = &privptr->channel[i]; |
3922 | p_ch->cdev = cdev; | 3923 | p_ch->cdev = cdev; |
3923 | snprintf(p_ch->id, CLAW_ID_SIZE, "cl-%s", cdev->dev.bus_id); | 3924 | snprintf(p_ch->id, CLAW_ID_SIZE, "cl-%s", cdev->dev.bus_id); |
3924 | sscanf(cdev->dev.bus_id+4,"%x",&p_ch->devno); | 3925 | ccw_device_get_id(cdev, &dev_id); |
3926 | p_ch->devno = dev_id.devno; | ||
3925 | if ((p_ch->irb = kmalloc(sizeof (struct irb),GFP_KERNEL)) == NULL) { | 3927 | if ((p_ch->irb = kmalloc(sizeof (struct irb),GFP_KERNEL)) == NULL) { |
3926 | printk(KERN_WARNING "%s Out of memory in %s for irb\n", | 3928 | printk(KERN_WARNING "%s Out of memory in %s for irb\n", |
3927 | p_ch->id,__FUNCTION__); | 3929 | p_ch->id,__FUNCTION__); |
@@ -3955,6 +3957,7 @@ claw_new_device(struct ccwgroup_device *cgdev) | |||
3955 | struct claw_env *p_env; | 3957 | struct claw_env *p_env; |
3956 | struct net_device *dev; | 3958 | struct net_device *dev; |
3957 | int ret; | 3959 | int ret; |
3960 | struct ccw_dev_id dev_id; | ||
3958 | 3961 | ||
3959 | pr_debug("%s() called\n", __FUNCTION__); | 3962 | pr_debug("%s() called\n", __FUNCTION__); |
3960 | printk(KERN_INFO "claw: add for %s\n",cgdev->cdev[READ]->dev.bus_id); | 3963 | 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) | |||
3965 | if (!privptr) | 3968 | if (!privptr) |
3966 | return -ENODEV; | 3969 | return -ENODEV; |
3967 | p_env = privptr->p_env; | 3970 | p_env = privptr->p_env; |
3968 | sscanf(cgdev->cdev[READ]->dev.bus_id+4,"%x", | 3971 | ccw_device_get_id(cgdev->cdev[READ], &dev_id); |
3969 | &p_env->devno[READ]); | 3972 | p_env->devno[READ] = dev_id.devno; |
3970 | sscanf(cgdev->cdev[WRITE]->dev.bus_id+4,"%x", | 3973 | ccw_device_get_id(cgdev->cdev[WRITE], &dev_id); |
3971 | &p_env->devno[WRITE]); | 3974 | p_env->devno[WRITE] = dev_id.devno; |
3972 | ret = add_channel(cgdev->cdev[0],0,privptr); | 3975 | ret = add_channel(cgdev->cdev[0],0,privptr); |
3973 | if (ret == 0) | 3976 | if (ret == 0) |
3974 | ret = add_channel(cgdev->cdev[1],1,privptr); | 3977 | ret = add_channel(cgdev->cdev[1],1,privptr); |
diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c index 79b7379a7849..86b0c44165c1 100644 --- a/drivers/s390/net/qeth_main.c +++ b/drivers/s390/net/qeth_main.c | |||
@@ -2176,13 +2176,6 @@ qeth_ulp_enable(struct qeth_card *card) | |||
2176 | 2176 | ||
2177 | } | 2177 | } |
2178 | 2178 | ||
2179 | static inline __u16 | ||
2180 | __raw_devno_from_bus_id(char *id) | ||
2181 | { | ||
2182 | id += (strlen(id) - 4); | ||
2183 | return (__u16) simple_strtoul(id, &id, 16); | ||
2184 | } | ||
2185 | |||
2186 | static int | 2179 | static int |
2187 | qeth_ulp_setup_cb(struct qeth_card *card, struct qeth_reply *reply, | 2180 | qeth_ulp_setup_cb(struct qeth_card *card, struct qeth_reply *reply, |
2188 | unsigned long data) | 2181 | unsigned long data) |
@@ -2205,6 +2198,7 @@ qeth_ulp_setup(struct qeth_card *card) | |||
2205 | int rc; | 2198 | int rc; |
2206 | __u16 temp; | 2199 | __u16 temp; |
2207 | struct qeth_cmd_buffer *iob; | 2200 | struct qeth_cmd_buffer *iob; |
2201 | struct ccw_dev_id dev_id; | ||
2208 | 2202 | ||
2209 | QETH_DBF_TEXT(setup,2,"ulpsetup"); | 2203 | QETH_DBF_TEXT(setup,2,"ulpsetup"); |
2210 | 2204 | ||
@@ -2218,8 +2212,8 @@ qeth_ulp_setup(struct qeth_card *card) | |||
2218 | memcpy(QETH_ULP_SETUP_FILTER_TOKEN(iob->data), | 2212 | memcpy(QETH_ULP_SETUP_FILTER_TOKEN(iob->data), |
2219 | &card->token.ulp_filter_r, QETH_MPC_TOKEN_LENGTH); | 2213 | &card->token.ulp_filter_r, QETH_MPC_TOKEN_LENGTH); |
2220 | 2214 | ||
2221 | temp = __raw_devno_from_bus_id(CARD_DDEV_ID(card)); | 2215 | ccw_device_get_id(CARD_DDEV(card), &dev_id); |
2222 | memcpy(QETH_ULP_SETUP_CUA(iob->data), &temp, 2); | 2216 | memcpy(QETH_ULP_SETUP_CUA(iob->data), &dev_id.devno, 2); |
2223 | temp = (card->info.cula << 8) + card->info.unit_addr2; | 2217 | temp = (card->info.cula << 8) + card->info.unit_addr2; |
2224 | memcpy(QETH_ULP_SETUP_REAL_DEVADDR(iob->data), &temp, 2); | 2218 | memcpy(QETH_ULP_SETUP_REAL_DEVADDR(iob->data), &temp, 2); |
2225 | rc = qeth_send_control_data(card, ULP_SETUP_SIZE, iob, | 2219 | rc = qeth_send_control_data(card, ULP_SETUP_SIZE, iob, |