aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390
diff options
context:
space:
mode:
authorCornelia Huck <cornelia.huck@de.ibm.com>2008-06-06 06:37:45 -0400
committerJeff Garzik <jgarzik@redhat.com>2008-06-10 18:20:35 -0400
commitf06f6f3224afdd7e58207d1f5950f4666c5f095f (patch)
tree11cca22e78805bb769c4488661bb5cf9539ee82f /drivers/s390
parente5bd7be56787f8c5042081157fff983bcf0c8a42 (diff)
qeth: Use ccw_device_get_id().
Get the devno from the ccw device via ccw_device_get_id() instead of parsing the bus_id. Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/s390')
-rw-r--r--drivers/s390/net/qeth_core_main.c11
-rw-r--r--drivers/s390/net/qeth_l2_main.c11
2 files changed, 7 insertions, 15 deletions
diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c
index 436bf1f6d4a6..5a71ae909366 100644
--- a/drivers/s390/net/qeth_core_main.c
+++ b/drivers/s390/net/qeth_core_main.c
@@ -1407,12 +1407,6 @@ static void qeth_init_func_level(struct qeth_card *card)
1407 } 1407 }
1408} 1408}
1409 1409
1410static inline __u16 qeth_raw_devno_from_bus_id(char *id)
1411{
1412 id += (strlen(id) - 4);
1413 return (__u16) simple_strtoul(id, &id, 16);
1414}
1415
1416static int qeth_idx_activate_get_answer(struct qeth_channel *channel, 1410static int qeth_idx_activate_get_answer(struct qeth_channel *channel,
1417 void (*idx_reply_cb)(struct qeth_channel *, 1411 void (*idx_reply_cb)(struct qeth_channel *,
1418 struct qeth_cmd_buffer *)) 1412 struct qeth_cmd_buffer *))
@@ -1468,6 +1462,7 @@ static int qeth_idx_activate_channel(struct qeth_channel *channel,
1468 __u16 temp; 1462 __u16 temp;
1469 __u8 tmp; 1463 __u8 tmp;
1470 int rc; 1464 int rc;
1465 struct ccw_dev_id temp_devid;
1471 1466
1472 card = CARD_FROM_CDEV(channel->ccwdev); 1467 card = CARD_FROM_CDEV(channel->ccwdev);
1473 1468
@@ -1494,8 +1489,8 @@ static int qeth_idx_activate_channel(struct qeth_channel *channel,
1494 &card->token.issuer_rm_w, QETH_MPC_TOKEN_LENGTH); 1489 &card->token.issuer_rm_w, QETH_MPC_TOKEN_LENGTH);
1495 memcpy(QETH_IDX_ACT_FUNC_LEVEL(iob->data), 1490 memcpy(QETH_IDX_ACT_FUNC_LEVEL(iob->data),
1496 &card->info.func_level, sizeof(__u16)); 1491 &card->info.func_level, sizeof(__u16));
1497 temp = qeth_raw_devno_from_bus_id(CARD_DDEV_ID(card)); 1492 ccw_device_get_id(CARD_DDEV(card), &temp_devid);
1498 memcpy(QETH_IDX_ACT_QDIO_DEV_CUA(iob->data), &temp, 2); 1493 memcpy(QETH_IDX_ACT_QDIO_DEV_CUA(iob->data), &temp_devid.devno, 2);
1499 temp = (card->info.cula << 8) + card->info.unit_addr2; 1494 temp = (card->info.cula << 8) + card->info.unit_addr2;
1500 memcpy(QETH_IDX_ACT_QDIO_DEV_REALADDR(iob->data), &temp, 2); 1495 memcpy(QETH_IDX_ACT_QDIO_DEV_REALADDR(iob->data), &temp, 2);
1501 1496
diff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c
index 86ec50ddae13..d35a74c3b475 100644
--- a/drivers/s390/net/qeth_l2_main.c
+++ b/drivers/s390/net/qeth_l2_main.c
@@ -101,19 +101,16 @@ static struct net_device *qeth_l2_netdev_by_devno(unsigned char *read_dev_no)
101{ 101{
102 struct qeth_card *card; 102 struct qeth_card *card;
103 struct net_device *ndev; 103 struct net_device *ndev;
104 unsigned char *readno; 104 __u16 temp_dev_no;
105 __u16 temp_dev_no, card_dev_no;
106 char *endp;
107 unsigned long flags; 105 unsigned long flags;
106 struct ccw_dev_id read_devid;
108 107
109 ndev = NULL; 108 ndev = NULL;
110 memcpy(&temp_dev_no, read_dev_no, 2); 109 memcpy(&temp_dev_no, read_dev_no, 2);
111 read_lock_irqsave(&qeth_core_card_list.rwlock, flags); 110 read_lock_irqsave(&qeth_core_card_list.rwlock, flags);
112 list_for_each_entry(card, &qeth_core_card_list.list, list) { 111 list_for_each_entry(card, &qeth_core_card_list.list, list) {
113 readno = CARD_RDEV_ID(card); 112 ccw_device_get_id(CARD_RDEV(card), &read_devid);
114 readno += (strlen(readno) - 4); 113 if (read_devid.devno == temp_dev_no) {
115 card_dev_no = simple_strtoul(readno, &endp, 16);
116 if (card_dev_no == temp_dev_no) {
117 ndev = card->dev; 114 ndev = card->dev;
118 break; 115 break;
119 } 116 }