diff options
author | Cornelia Huck <huckc@de.ibm.com> | 2006-01-06 03:19:26 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-06 11:33:52 -0500 |
commit | 3b793060e768197d525e892fd1f84dbc8767cada (patch) | |
tree | 94b3860f2a5324effb71d2c09aac9ff55e02dcb2 /drivers/s390/cio | |
parent | 88fbf18399bde8f2900cf932acd40733dfa1effa (diff) |
[PATCH] s390: Fix missing release function and cosmetic changes
- Use kzalloc() in blacklist.c.
- Kill unwanted casts in blacklist.c.
- Provide release function for struct channel_subsystem.
Signed-off-by: Cornelia Huck <huckc@de.ibm.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/s390/cio')
-rw-r--r-- | drivers/s390/cio/blacklist.c | 7 | ||||
-rw-r--r-- | drivers/s390/cio/css.c | 10 |
2 files changed, 13 insertions, 4 deletions
diff --git a/drivers/s390/cio/blacklist.c b/drivers/s390/cio/blacklist.c index 2d444cb2fdf7..daf21e03b21d 100644 --- a/drivers/s390/cio/blacklist.c +++ b/drivers/s390/cio/blacklist.c | |||
@@ -299,10 +299,9 @@ cio_ignore_proc_seq_start(struct seq_file *s, loff_t *offset) | |||
299 | 299 | ||
300 | if (*offset >= (__MAX_SUBCHANNEL + 1) * (__MAX_SSID + 1)) | 300 | if (*offset >= (__MAX_SUBCHANNEL + 1) * (__MAX_SSID + 1)) |
301 | return NULL; | 301 | return NULL; |
302 | iter = kmalloc(sizeof(struct ccwdev_iter), GFP_KERNEL); | 302 | iter = kzalloc(sizeof(struct ccwdev_iter), GFP_KERNEL); |
303 | if (!iter) | 303 | if (!iter) |
304 | return ERR_PTR(-ENOMEM); | 304 | return ERR_PTR(-ENOMEM); |
305 | memset(iter, 0, sizeof(struct ccwdev_iter)); | ||
306 | iter->ssid = *offset / (__MAX_SUBCHANNEL + 1); | 305 | iter->ssid = *offset / (__MAX_SUBCHANNEL + 1); |
307 | iter->devno = *offset % (__MAX_SUBCHANNEL + 1); | 306 | iter->devno = *offset % (__MAX_SUBCHANNEL + 1); |
308 | return iter; | 307 | return iter; |
@@ -322,7 +321,7 @@ cio_ignore_proc_seq_next(struct seq_file *s, void *it, loff_t *offset) | |||
322 | 321 | ||
323 | if (*offset >= (__MAX_SUBCHANNEL + 1) * (__MAX_SSID + 1)) | 322 | if (*offset >= (__MAX_SUBCHANNEL + 1) * (__MAX_SSID + 1)) |
324 | return NULL; | 323 | return NULL; |
325 | iter = (struct ccwdev_iter *)it; | 324 | iter = it; |
326 | if (iter->devno == __MAX_SUBCHANNEL) { | 325 | if (iter->devno == __MAX_SUBCHANNEL) { |
327 | iter->devno = 0; | 326 | iter->devno = 0; |
328 | iter->ssid++; | 327 | iter->ssid++; |
@@ -339,7 +338,7 @@ cio_ignore_proc_seq_show(struct seq_file *s, void *it) | |||
339 | { | 338 | { |
340 | struct ccwdev_iter *iter; | 339 | struct ccwdev_iter *iter; |
341 | 340 | ||
342 | iter = (struct ccwdev_iter *)it; | 341 | iter = it; |
343 | if (!is_blacklisted(iter->ssid, iter->devno)) | 342 | if (!is_blacklisted(iter->ssid, iter->devno)) |
344 | /* Not blacklisted, nothing to output. */ | 343 | /* Not blacklisted, nothing to output. */ |
345 | return 0; | 344 | return 0; |
diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c index 9e9d4a157a4c..e565193650c7 100644 --- a/drivers/s390/cio/css.c +++ b/drivers/s390/cio/css.c | |||
@@ -444,6 +444,15 @@ css_generate_pgid(struct channel_subsystem *css, u32 tod_high) | |||
444 | 444 | ||
445 | } | 445 | } |
446 | 446 | ||
447 | static void | ||
448 | channel_subsystem_release(struct device *dev) | ||
449 | { | ||
450 | struct channel_subsystem *css; | ||
451 | |||
452 | css = to_css(dev); | ||
453 | kfree(css); | ||
454 | } | ||
455 | |||
447 | static inline void __init | 456 | static inline void __init |
448 | setup_css(int nr) | 457 | setup_css(int nr) |
449 | { | 458 | { |
@@ -453,6 +462,7 @@ setup_css(int nr) | |||
453 | css[nr]->valid = 1; | 462 | css[nr]->valid = 1; |
454 | css[nr]->cssid = nr; | 463 | css[nr]->cssid = nr; |
455 | sprintf(css[nr]->device.bus_id, "css%x", nr); | 464 | sprintf(css[nr]->device.bus_id, "css%x", nr); |
465 | css[nr]->device.release = channel_subsystem_release; | ||
456 | tod_high = (u32) (get_clock() >> 32); | 466 | tod_high = (u32) (get_clock() >> 32); |
457 | css_generate_pgid(css[nr], tod_high); | 467 | css_generate_pgid(css[nr], tod_high); |
458 | } | 468 | } |