diff options
-rw-r--r-- | drivers/mtd/mtd_blkdevs.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c index 5d0e13d9f24a..d6cb3d194efb 100644 --- a/drivers/mtd/mtd_blkdevs.c +++ b/drivers/mtd/mtd_blkdevs.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * $Id: mtd_blkdevs.c,v 1.25 2005/07/29 01:57:55 tpoynor Exp $ | 2 | * $Id: mtd_blkdevs.c,v 1.26 2005/07/29 19:42:04 tpoynor Exp $ |
3 | * | 3 | * |
4 | * (C) 2003 David Woodhouse <dwmw2@infradead.org> | 4 | * (C) 2003 David Woodhouse <dwmw2@infradead.org> |
5 | * | 5 | * |
@@ -289,8 +289,18 @@ int add_mtd_blktrans_dev(struct mtd_blktrans_dev *new) | |||
289 | gd->first_minor = (new->devnum) << tr->part_bits; | 289 | gd->first_minor = (new->devnum) << tr->part_bits; |
290 | gd->fops = &mtd_blktrans_ops; | 290 | gd->fops = &mtd_blktrans_ops; |
291 | 291 | ||
292 | snprintf(gd->disk_name, sizeof(gd->disk_name), | 292 | if (tr->part_bits) |
293 | "%s%c", tr->name, (tr->part_bits?'a':'0') + new->devnum); | 293 | if (new->devnum < 26) |
294 | snprintf(gd->disk_name, sizeof(gd->disk_name), | ||
295 | "%s%c", tr->name, 'a' + new->devnum); | ||
296 | else | ||
297 | snprintf(gd->disk_name, sizeof(gd->disk_name), | ||
298 | "%s%c%c", tr->name, | ||
299 | 'a' - 1 + new->devnum / 26, | ||
300 | 'a' + new->devnum % 26); | ||
301 | else | ||
302 | snprintf(gd->disk_name, sizeof(gd->disk_name), | ||
303 | "%s%d", tr->name, new->devnum); | ||
294 | 304 | ||
295 | /* 2.5 has capacity in units of 512 bytes while still | 305 | /* 2.5 has capacity in units of 512 bytes while still |
296 | having BLOCK_SIZE_BITS set to 10. Just to keep us amused. */ | 306 | having BLOCK_SIZE_BITS set to 10. Just to keep us amused. */ |