diff options
Diffstat (limited to 'drivers/mtd/maps/tqm834x.c')
-rw-r--r-- | drivers/mtd/maps/tqm834x.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/mtd/maps/tqm834x.c b/drivers/mtd/maps/tqm834x.c index 58e5912bd381..9adc970e55e6 100644 --- a/drivers/mtd/maps/tqm834x.c +++ b/drivers/mtd/maps/tqm834x.c | |||
@@ -132,20 +132,16 @@ static int __init init_tqm834x_mtd(void) | |||
132 | 132 | ||
133 | pr_debug("%s: chip probing count %d\n", __FUNCTION__, idx); | 133 | pr_debug("%s: chip probing count %d\n", __FUNCTION__, idx); |
134 | 134 | ||
135 | map_banks[idx] = | 135 | map_banks[idx] = kzalloc(sizeof(struct map_info), GFP_KERNEL); |
136 | (struct map_info *)kmalloc(sizeof(struct map_info), | ||
137 | GFP_KERNEL); | ||
138 | if (map_banks[idx] == NULL) { | 136 | if (map_banks[idx] == NULL) { |
139 | ret = -ENOMEM; | 137 | ret = -ENOMEM; |
140 | goto error_mem; | 138 | goto error_mem; |
141 | } | 139 | } |
142 | memset((void *)map_banks[idx], 0, sizeof(struct map_info)); | 140 | map_banks[idx]->name = kzalloc(16, GFP_KERNEL); |
143 | map_banks[idx]->name = (char *)kmalloc(16, GFP_KERNEL); | ||
144 | if (map_banks[idx]->name == NULL) { | 141 | if (map_banks[idx]->name == NULL) { |
145 | ret = -ENOMEM; | 142 | ret = -ENOMEM; |
146 | goto error_mem; | 143 | goto error_mem; |
147 | } | 144 | } |
148 | memset((void *)map_banks[idx]->name, 0, 16); | ||
149 | 145 | ||
150 | sprintf(map_banks[idx]->name, "TQM834x-%d", idx); | 146 | sprintf(map_banks[idx]->name, "TQM834x-%d", idx); |
151 | map_banks[idx]->size = flash_size; | 147 | map_banks[idx]->size = flash_size; |