diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2008-12-25 07:38:55 -0500 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2008-12-25 07:39:03 -0500 |
commit | 98df67b324a2a986987ce29986e44ae9156b6698 (patch) | |
tree | 13cd3c37116c115761c54184cdd8e41e164a6c84 /drivers/s390 | |
parent | 0cd4bd4754d51bdc8f9cd880c29910d0d52337bb (diff) |
[S390] struct device - replace bus_id with dev_name(), dev_set_name()
Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390')
-rw-r--r-- | drivers/s390/block/dasd_devmap.c | 13 | ||||
-rw-r--r-- | drivers/s390/block/dcssblk.c | 5 | ||||
-rw-r--r-- | drivers/s390/cio/ccwgroup.c | 8 | ||||
-rw-r--r-- | drivers/s390/cio/device.c | 2 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_aux.c | 6 |
5 files changed, 20 insertions, 14 deletions
diff --git a/drivers/s390/block/dasd_devmap.c b/drivers/s390/block/dasd_devmap.c index 3f4881e01cb6..2ef25731d197 100644 --- a/drivers/s390/block/dasd_devmap.c +++ b/drivers/s390/block/dasd_devmap.c | |||
@@ -23,6 +23,7 @@ | |||
23 | 23 | ||
24 | /* This is ugly... */ | 24 | /* This is ugly... */ |
25 | #define PRINTK_HEADER "dasd_devmap:" | 25 | #define PRINTK_HEADER "dasd_devmap:" |
26 | #define DASD_BUS_ID_SIZE 20 | ||
26 | 27 | ||
27 | #include "dasd_int.h" | 28 | #include "dasd_int.h" |
28 | 29 | ||
@@ -41,7 +42,7 @@ EXPORT_SYMBOL_GPL(dasd_page_cache); | |||
41 | */ | 42 | */ |
42 | struct dasd_devmap { | 43 | struct dasd_devmap { |
43 | struct list_head list; | 44 | struct list_head list; |
44 | char bus_id[BUS_ID_SIZE]; | 45 | char bus_id[DASD_BUS_ID_SIZE]; |
45 | unsigned int devindex; | 46 | unsigned int devindex; |
46 | unsigned short features; | 47 | unsigned short features; |
47 | struct dasd_device *device; | 48 | struct dasd_device *device; |
@@ -94,7 +95,7 @@ dasd_hash_busid(const char *bus_id) | |||
94 | int hash, i; | 95 | int hash, i; |
95 | 96 | ||
96 | hash = 0; | 97 | hash = 0; |
97 | for (i = 0; (i < BUS_ID_SIZE) && *bus_id; i++, bus_id++) | 98 | for (i = 0; (i < DASD_BUS_ID_SIZE) && *bus_id; i++, bus_id++) |
98 | hash += *bus_id; | 99 | hash += *bus_id; |
99 | return hash & 0xff; | 100 | return hash & 0xff; |
100 | } | 101 | } |
@@ -301,7 +302,7 @@ dasd_parse_range( char *parsestring ) { | |||
301 | int from, from_id0, from_id1; | 302 | int from, from_id0, from_id1; |
302 | int to, to_id0, to_id1; | 303 | int to, to_id0, to_id1; |
303 | int features, rc; | 304 | int features, rc; |
304 | char bus_id[BUS_ID_SIZE+1], *str; | 305 | char bus_id[DASD_BUS_ID_SIZE+1], *str; |
305 | 306 | ||
306 | str = parsestring; | 307 | str = parsestring; |
307 | rc = dasd_busid(&str, &from_id0, &from_id1, &from); | 308 | rc = dasd_busid(&str, &from_id0, &from_id1, &from); |
@@ -407,14 +408,14 @@ dasd_add_busid(const char *bus_id, int features) | |||
407 | devmap = NULL; | 408 | devmap = NULL; |
408 | hash = dasd_hash_busid(bus_id); | 409 | hash = dasd_hash_busid(bus_id); |
409 | list_for_each_entry(tmp, &dasd_hashlists[hash], list) | 410 | list_for_each_entry(tmp, &dasd_hashlists[hash], list) |
410 | if (strncmp(tmp->bus_id, bus_id, BUS_ID_SIZE) == 0) { | 411 | if (strncmp(tmp->bus_id, bus_id, DASD_BUS_ID_SIZE) == 0) { |
411 | devmap = tmp; | 412 | devmap = tmp; |
412 | break; | 413 | break; |
413 | } | 414 | } |
414 | if (!devmap) { | 415 | if (!devmap) { |
415 | /* This bus_id is new. */ | 416 | /* This bus_id is new. */ |
416 | new->devindex = dasd_max_devindex++; | 417 | new->devindex = dasd_max_devindex++; |
417 | strncpy(new->bus_id, bus_id, BUS_ID_SIZE); | 418 | strncpy(new->bus_id, bus_id, DASD_BUS_ID_SIZE); |
418 | new->features = features; | 419 | new->features = features; |
419 | new->device = NULL; | 420 | new->device = NULL; |
420 | list_add(&new->list, &dasd_hashlists[hash]); | 421 | list_add(&new->list, &dasd_hashlists[hash]); |
@@ -439,7 +440,7 @@ dasd_find_busid(const char *bus_id) | |||
439 | devmap = ERR_PTR(-ENODEV); | 440 | devmap = ERR_PTR(-ENODEV); |
440 | hash = dasd_hash_busid(bus_id); | 441 | hash = dasd_hash_busid(bus_id); |
441 | list_for_each_entry(tmp, &dasd_hashlists[hash], list) { | 442 | list_for_each_entry(tmp, &dasd_hashlists[hash], list) { |
442 | if (strncmp(tmp->bus_id, bus_id, BUS_ID_SIZE) == 0) { | 443 | if (strncmp(tmp->bus_id, bus_id, DASD_BUS_ID_SIZE) == 0) { |
443 | devmap = tmp; | 444 | devmap = tmp; |
444 | break; | 445 | break; |
445 | } | 446 | } |
diff --git a/drivers/s390/block/dcssblk.c b/drivers/s390/block/dcssblk.c index 63f26a135fe5..b1b204c448ed 100644 --- a/drivers/s390/block/dcssblk.c +++ b/drivers/s390/block/dcssblk.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #define DCSSBLK_NAME "dcssblk" | 21 | #define DCSSBLK_NAME "dcssblk" |
22 | #define DCSSBLK_MINORS_PER_DISK 1 | 22 | #define DCSSBLK_MINORS_PER_DISK 1 |
23 | #define DCSSBLK_PARM_LEN 400 | 23 | #define DCSSBLK_PARM_LEN 400 |
24 | #define DCSS_BUS_ID_SIZE 20 | ||
24 | 25 | ||
25 | #ifdef DCSSBLK_DEBUG | 26 | #ifdef DCSSBLK_DEBUG |
26 | #define PRINT_DEBUG(x...) printk(KERN_DEBUG DCSSBLK_NAME " debug: " x) | 27 | #define PRINT_DEBUG(x...) printk(KERN_DEBUG DCSSBLK_NAME " debug: " x) |
@@ -50,7 +51,7 @@ static struct block_device_operations dcssblk_devops = { | |||
50 | struct dcssblk_dev_info { | 51 | struct dcssblk_dev_info { |
51 | struct list_head lh; | 52 | struct list_head lh; |
52 | struct device dev; | 53 | struct device dev; |
53 | char segment_name[BUS_ID_SIZE]; | 54 | char segment_name[DCSS_BUS_ID_SIZE]; |
54 | atomic_t use_count; | 55 | atomic_t use_count; |
55 | struct gendisk *gd; | 56 | struct gendisk *gd; |
56 | unsigned long start; | 57 | unsigned long start; |
@@ -65,7 +66,7 @@ struct dcssblk_dev_info { | |||
65 | 66 | ||
66 | struct segment_info { | 67 | struct segment_info { |
67 | struct list_head lh; | 68 | struct list_head lh; |
68 | char segment_name[BUS_ID_SIZE]; | 69 | char segment_name[DCSS_BUS_ID_SIZE]; |
69 | unsigned long start; | 70 | unsigned long start; |
70 | unsigned long end; | 71 | unsigned long end; |
71 | int segment_type; | 72 | int segment_type; |
diff --git a/drivers/s390/cio/ccwgroup.c b/drivers/s390/cio/ccwgroup.c index 3ac2c2019f5e..17fa009d9959 100644 --- a/drivers/s390/cio/ccwgroup.c +++ b/drivers/s390/cio/ccwgroup.c | |||
@@ -19,6 +19,8 @@ | |||
19 | #include <asm/ccwdev.h> | 19 | #include <asm/ccwdev.h> |
20 | #include <asm/ccwgroup.h> | 20 | #include <asm/ccwgroup.h> |
21 | 21 | ||
22 | #define CCW_BUS_ID_SIZE 20 | ||
23 | |||
22 | /* In Linux 2.4, we had a channel device layer called "chandev" | 24 | /* In Linux 2.4, we had a channel device layer called "chandev" |
23 | * that did all sorts of obscure stuff for networking devices. | 25 | * that did all sorts of obscure stuff for networking devices. |
24 | * This is another driver that serves as a replacement for just | 26 | * This is another driver that serves as a replacement for just |
@@ -172,7 +174,7 @@ static int __get_next_bus_id(const char **buf, char *bus_id) | |||
172 | len = end - start + 1; | 174 | len = end - start + 1; |
173 | end++; | 175 | end++; |
174 | } | 176 | } |
175 | if (len < BUS_ID_SIZE) { | 177 | if (len < CCW_BUS_ID_SIZE) { |
176 | strlcpy(bus_id, start, len); | 178 | strlcpy(bus_id, start, len); |
177 | rc = 0; | 179 | rc = 0; |
178 | } else | 180 | } else |
@@ -181,7 +183,7 @@ static int __get_next_bus_id(const char **buf, char *bus_id) | |||
181 | return rc; | 183 | return rc; |
182 | } | 184 | } |
183 | 185 | ||
184 | static int __is_valid_bus_id(char bus_id[BUS_ID_SIZE]) | 186 | static int __is_valid_bus_id(char bus_id[CCW_BUS_ID_SIZE]) |
185 | { | 187 | { |
186 | int cssid, ssid, devno; | 188 | int cssid, ssid, devno; |
187 | 189 | ||
@@ -213,7 +215,7 @@ int ccwgroup_create_from_string(struct device *root, unsigned int creator_id, | |||
213 | { | 215 | { |
214 | struct ccwgroup_device *gdev; | 216 | struct ccwgroup_device *gdev; |
215 | int rc, i; | 217 | int rc, i; |
216 | char tmp_bus_id[BUS_ID_SIZE]; | 218 | char tmp_bus_id[CCW_BUS_ID_SIZE]; |
217 | const char *curr_buf; | 219 | const char *curr_buf; |
218 | 220 | ||
219 | gdev = kzalloc(sizeof(*gdev) + num_devices * sizeof(gdev->cdev[0]), | 221 | gdev = kzalloc(sizeof(*gdev) + num_devices * sizeof(gdev->cdev[0]), |
diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c index 4e4008325e28..fac85160a753 100644 --- a/drivers/s390/cio/device.c +++ b/drivers/s390/cio/device.c | |||
@@ -1723,7 +1723,7 @@ __ccwdev_check_busid(struct device *dev, void *id) | |||
1723 | 1723 | ||
1724 | bus_id = id; | 1724 | bus_id = id; |
1725 | 1725 | ||
1726 | return (strncmp(bus_id, dev_name(dev), BUS_ID_SIZE) == 0); | 1726 | return (strcmp(bus_id, dev_name(dev)) == 0); |
1727 | } | 1727 | } |
1728 | 1728 | ||
1729 | 1729 | ||
diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c index fc4a28953824..f140b46df12a 100644 --- a/drivers/s390/scsi/zfcp_aux.c +++ b/drivers/s390/scsi/zfcp_aux.c | |||
@@ -29,6 +29,8 @@ | |||
29 | #include <linux/seq_file.h> | 29 | #include <linux/seq_file.h> |
30 | #include "zfcp_ext.h" | 30 | #include "zfcp_ext.h" |
31 | 31 | ||
32 | #define ZFCP_BUS_ID_SIZE 20 | ||
33 | |||
32 | static char *device; | 34 | static char *device; |
33 | 35 | ||
34 | MODULE_AUTHOR("IBM Deutschland Entwicklung GmbH - linux390@de.ibm.com"); | 36 | MODULE_AUTHOR("IBM Deutschland Entwicklung GmbH - linux390@de.ibm.com"); |
@@ -84,9 +86,9 @@ static int __init zfcp_device_setup(char *devstr) | |||
84 | strcpy(str, devstr); | 86 | strcpy(str, devstr); |
85 | 87 | ||
86 | token = strsep(&str, ","); | 88 | token = strsep(&str, ","); |
87 | if (!token || strlen(token) >= BUS_ID_SIZE) | 89 | if (!token || strlen(token) >= ZFCP_BUS_ID_SIZE) |
88 | goto err_out; | 90 | goto err_out; |
89 | strncpy(zfcp_data.init_busid, token, BUS_ID_SIZE); | 91 | strncpy(zfcp_data.init_busid, token, ZFCP_BUS_ID_SIZE); |
90 | 92 | ||
91 | token = strsep(&str, ","); | 93 | token = strsep(&str, ","); |
92 | if (!token || strict_strtoull(token, 0, | 94 | if (!token || strict_strtoull(token, 0, |