aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/ubi/build.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/build.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/build.c')
-rw-r--r--drivers/mtd/ubi/build.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c
index 023653977a1a..b0791f795056 100644
--- a/drivers/mtd/ubi/build.c
+++ b/drivers/mtd/ubi/build.c
@@ -150,7 +150,7 @@ static int ubi_sysfs_init(struct ubi_device *ubi)
150 int err; 150 int err;
151 151
152 ubi->dev.release = dev_release; 152 ubi->dev.release = dev_release;
153 ubi->dev.devt = MKDEV(ubi->major, 0); 153 ubi->dev.devt = ubi->cdev.dev;
154 ubi->dev.class = ubi_class; 154 ubi->dev.class = ubi_class;
155 sprintf(&ubi->dev.bus_id[0], UBI_NAME_STR"%d", ubi->ubi_num); 155 sprintf(&ubi->dev.bus_id[0], UBI_NAME_STR"%d", ubi->ubi_num);
156 err = device_register(&ubi->dev); 156 err = device_register(&ubi->dev);
@@ -278,12 +278,11 @@ static int uif_init(struct ubi_device *ubi)
278 return err; 278 return err;
279 } 279 }
280 280
281 ubi_assert(MINOR(dev) == 0);
281 cdev_init(&ubi->cdev, &ubi_cdev_operations); 282 cdev_init(&ubi->cdev, &ubi_cdev_operations);
282 ubi->major = MAJOR(dev); 283 dbg_msg("%s major is %u", ubi->ubi_name, MAJOR(dev));
283 dbg_msg("%s major is %u", ubi->ubi_name, ubi->major);
284 ubi->cdev.owner = THIS_MODULE; 284 ubi->cdev.owner = THIS_MODULE;
285 285
286 dev = MKDEV(ubi->major, 0);
287 err = cdev_add(&ubi->cdev, dev, 1); 286 err = cdev_add(&ubi->cdev, dev, 1);
288 if (err) { 287 if (err) {
289 ubi_err("cannot add character device %s", ubi->ubi_name); 288 ubi_err("cannot add character device %s", ubi->ubi_name);
@@ -309,8 +308,7 @@ out_volumes:
309out_cdev: 308out_cdev:
310 cdev_del(&ubi->cdev); 309 cdev_del(&ubi->cdev);
311out_unreg: 310out_unreg:
312 unregister_chrdev_region(MKDEV(ubi->major, 0), 311 unregister_chrdev_region(ubi->cdev.dev, ubi->vtbl_slots + 1);
313 ubi->vtbl_slots + 1);
314 return err; 312 return err;
315} 313}
316 314
@@ -323,7 +321,7 @@ static void uif_close(struct ubi_device *ubi)
323 kill_volumes(ubi); 321 kill_volumes(ubi);
324 ubi_sysfs_close(ubi); 322 ubi_sysfs_close(ubi);
325 cdev_del(&ubi->cdev); 323 cdev_del(&ubi->cdev);
326 unregister_chrdev_region(MKDEV(ubi->major, 0), ubi->vtbl_slots + 1); 324 unregister_chrdev_region(ubi->cdev.dev, ubi->vtbl_slots + 1);
327} 325}
328 326
329/** 327/**