aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/ubi/vmt.c
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2007-12-15 11:13:56 -0500
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2007-12-26 12:15:14 -0500
commit49dfc299288fe183b62a3f679a40c91b482d6d73 (patch)
treea4860162ae77f9c118619ec5562626c25a2f7800 /drivers/mtd/ubi/vmt.c
parent732aeacff6b2fcf3750cad9018bdd663a21a6a12 (diff)
UBI: remove redundant field
Remove redundant ubi->major field - we have it in ubi->cdev.dev already. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'drivers/mtd/ubi/vmt.c')
-rw-r--r--drivers/mtd/ubi/vmt.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/mtd/ubi/vmt.c b/drivers/mtd/ubi/vmt.c
index 58d6abe50bfc..6609c319c83c 100644
--- a/drivers/mtd/ubi/vmt.c
+++ b/drivers/mtd/ubi/vmt.c
@@ -192,6 +192,7 @@ int ubi_create_volume(struct ubi_device *ubi, struct ubi_mkvol_req *req)
192 struct ubi_volume *vol; 192 struct ubi_volume *vol;
193 struct ubi_vtbl_record vtbl_rec; 193 struct ubi_vtbl_record vtbl_rec;
194 uint64_t bytes; 194 uint64_t bytes;
195 dev_t dev;
195 196
196 if (ubi->ro_mode) 197 if (ubi->ro_mode)
197 return -EROFS; 198 return -EROFS;
@@ -301,7 +302,8 @@ int ubi_create_volume(struct ubi_device *ubi, struct ubi_mkvol_req *req)
301 /* Register character device for the volume */ 302 /* Register character device for the volume */
302 cdev_init(&vol->cdev, &ubi_vol_cdev_operations); 303 cdev_init(&vol->cdev, &ubi_vol_cdev_operations);
303 vol->cdev.owner = THIS_MODULE; 304 vol->cdev.owner = THIS_MODULE;
304 err = cdev_add(&vol->cdev, MKDEV(ubi->major, vol_id + 1), 1); 305 dev = MKDEV(MAJOR(ubi->cdev.dev), vol_id + 1);
306 err = cdev_add(&vol->cdev, dev, 1);
305 if (err) { 307 if (err) {
306 ubi_err("cannot add character device for volume %d", vol_id); 308 ubi_err("cannot add character device for volume %d", vol_id);
307 goto out_mapping; 309 goto out_mapping;
@@ -313,7 +315,7 @@ int ubi_create_volume(struct ubi_device *ubi, struct ubi_mkvol_req *req)
313 315
314 vol->dev.release = vol_release; 316 vol->dev.release = vol_release;
315 vol->dev.parent = &ubi->dev; 317 vol->dev.parent = &ubi->dev;
316 vol->dev.devt = MKDEV(ubi->major, vol->vol_id + 1); 318 vol->dev.devt = dev;
317 vol->dev.class = ubi_class; 319 vol->dev.class = ubi_class;
318 sprintf(&vol->dev.bus_id[0], "%s_%d", ubi->ubi_name, vol->vol_id); 320 sprintf(&vol->dev.bus_id[0], "%s_%d", ubi->ubi_name, vol->vol_id);
319 err = device_register(&vol->dev); 321 err = device_register(&vol->dev);
@@ -576,6 +578,7 @@ out_free:
576int ubi_add_volume(struct ubi_device *ubi, int vol_id) 578int ubi_add_volume(struct ubi_device *ubi, int vol_id)
577{ 579{
578 int err; 580 int err;
581 dev_t dev;
579 struct ubi_volume *vol = ubi->volumes[vol_id]; 582 struct ubi_volume *vol = ubi->volumes[vol_id];
580 583
581 dbg_msg("add volume %d", vol_id); 584 dbg_msg("add volume %d", vol_id);
@@ -585,7 +588,8 @@ int ubi_add_volume(struct ubi_device *ubi, int vol_id)
585 /* Register character device for the volume */ 588 /* Register character device for the volume */
586 cdev_init(&vol->cdev, &ubi_vol_cdev_operations); 589 cdev_init(&vol->cdev, &ubi_vol_cdev_operations);
587 vol->cdev.owner = THIS_MODULE; 590 vol->cdev.owner = THIS_MODULE;
588 err = cdev_add(&vol->cdev, MKDEV(ubi->major, vol->vol_id + 1), 1); 591 dev = MKDEV(MAJOR(ubi->cdev.dev), vol->vol_id + 1);
592 err = cdev_add(&vol->cdev, dev, 1);
589 if (err) { 593 if (err) {
590 ubi_err("cannot add character device for volume %d", vol_id); 594 ubi_err("cannot add character device for volume %d", vol_id);
591 return err; 595 return err;
@@ -597,7 +601,7 @@ int ubi_add_volume(struct ubi_device *ubi, int vol_id)
597 601
598 vol->dev.release = vol_release; 602 vol->dev.release = vol_release;
599 vol->dev.parent = &ubi->dev; 603 vol->dev.parent = &ubi->dev;
600 vol->dev.devt = MKDEV(ubi->major, vol->vol_id + 1); 604 vol->dev.devt = dev;
601 vol->dev.class = ubi_class; 605 vol->dev.class = ubi_class;
602 sprintf(&vol->dev.bus_id[0], "%s_%d", ubi->ubi_name, vol->vol_id); 606 sprintf(&vol->dev.bus_id[0], "%s_%d", ubi->ubi_name, vol->vol_id);
603 err = device_register(&vol->dev); 607 err = device_register(&vol->dev);