diff options
| author | Alexander Viro <viro@math.psu.edu> | 2002-09-07 03:05:14 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.transmeta.com> | 2002-09-07 03:05:14 -0700 |
| commit | e86a37861c8a0830d7410bf9ebe5ebaf5f6adc7f (patch) | |
| tree | 9441ca4833309bbf6acc94fea3082184476a396d /drivers/block/cpqarray.c | |
| parent | 3708de94cf8d66e46d5ab7d712da81684ff99bf7 (diff) | |
[PATCH] (25/25) more cleanups of struct gendisk.
* we remove the paritition 0 from ->part[] and put the old
contents of ->part[0] into gendisk itself; indexes are shifted, obviously.
* ->part is allocated at add_gendisk() time and freed at del_gendisk()
according to value of ->minor_shift; static arrays of hd_struct are gone
from drivers, ditto for manual allocations a-la ide. As the matter of fact,
none of the drivers know about struct hd_struct now.
Diffstat (limited to 'drivers/block/cpqarray.c')
| -rw-r--r-- | drivers/block/cpqarray.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/drivers/block/cpqarray.c b/drivers/block/cpqarray.c index 2d6ff7620e46..aec445236fa0 100644 --- a/drivers/block/cpqarray.c +++ b/drivers/block/cpqarray.c @@ -102,7 +102,6 @@ static struct board_type products[] = { { 0x40580E11, "Smart Array 431", &smart4_access }, }; -static struct hd_struct * ida; static char *ida_names; static struct gendisk ida_gendisk[MAX_CTLR * NWD]; @@ -320,7 +319,6 @@ void cleanup_module(void) } devfs_find_and_unregister(NULL, "ida", 0, 0, 0, 0); remove_proc_entry("cpqarray", proc_root_driver); - kfree(ida); kfree(ida_names); } #endif /* MODULE */ @@ -346,15 +344,12 @@ int __init cpqarray_init(void) printk("Found %d controller(s)\n", nr_ctlr); /* allocate space for disk structs */ - ida = kmalloc(sizeof(struct hd_struct)*nr_ctlr*NWD*16, GFP_KERNEL); ida_names = kmalloc(nr_ctlr*NWD*10, GFP_KERNEL); - if (!ida || !ida_names) { + if (!ida_names) { printk( KERN_ERR "cpqarray: out of memory"); - kfree(ida); kfree(ida_names); return(num_cntlrs_reg); } - memset(ida, 0, sizeof(struct hd_struct)*nr_ctlr*NWD*16); /* * register block devices * Find disks and fill in structs @@ -407,7 +402,6 @@ int __init cpqarray_init(void) if (num_cntlrs_reg == 0) { - kfree(ida); kfree(ida_names); } return(num_cntlrs_reg); @@ -449,7 +443,6 @@ int __init cpqarray_init(void) disk->major = MAJOR_NR + i; disk->first_minor = j<<NWD_SHIFT; disk->minor_shift = NWD_SHIFT; - disk->part = ida + i*256 + (j<<NWD_SHIFT); disk->flags = GENHD_FL_DEVFS; disk->fops = &ida_fops; if (!drv->nr_blks) @@ -1462,7 +1455,6 @@ static int revalidate_allvol(kdev_t dev) del_gendisk(disk); disk->major_name = NULL; } - memset(ida+(ctlr*256), 0, sizeof(struct hd_struct)*NWD*16); memset(hba[ctlr]->drv, 0, sizeof(drv_info_t)*NWD); /* |
