aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/ubi
diff options
context:
space:
mode:
authorDmitry Pervushin <dpervushin@embeddedalley.com>2009-04-29 11:29:44 -0400
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2009-06-02 06:53:35 -0400
commit518ceef0c9ca97023e45ae46aedaefa240c690a6 (patch)
tree6086ce9a6177bd0e4ef4da50e0205bbc8a5e5cc3 /drivers/mtd/ubi
parent0e0ee1cc33de8f0cc603269b354085dee340afa0 (diff)
UBI: remove built-in gluebi
Remove built-in gluebi support. This is a preparation for a standalone glubi module support Signed-off-by: Dmitry Pervushin <dpervushin@embeddedalley.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'drivers/mtd/ubi')
-rw-r--r--drivers/mtd/ubi/cdev.c1
-rw-r--r--drivers/mtd/ubi/ubi.h26
-rw-r--r--drivers/mtd/ubi/vmt.c26
3 files changed, 2 insertions, 51 deletions
diff --git a/drivers/mtd/ubi/cdev.c b/drivers/mtd/ubi/cdev.c
index 631983615f11..f237ddbb2713 100644
--- a/drivers/mtd/ubi/cdev.c
+++ b/drivers/mtd/ubi/cdev.c
@@ -395,7 +395,6 @@ static ssize_t vol_cdev_write(struct file *file, const char __user *buf,
395 vol->corrupted = 1; 395 vol->corrupted = 1;
396 } 396 }
397 vol->checked = 1; 397 vol->checked = 1;
398 ubi_gluebi_updated(vol);
399 ubi_volume_notify(ubi, vol, UBI_VOLUME_UPDATED); 398 ubi_volume_notify(ubi, vol, UBI_VOLUME_UPDATED);
400 revoke_exclusive(desc, UBI_READWRITE); 399 revoke_exclusive(desc, UBI_READWRITE);
401 } 400 }
diff --git a/drivers/mtd/ubi/ubi.h b/drivers/mtd/ubi/ubi.h
index 86e1a4e0ab01..82da62bde413 100644
--- a/drivers/mtd/ubi/ubi.h
+++ b/drivers/mtd/ubi/ubi.h
@@ -231,10 +231,6 @@ struct ubi_volume_desc;
231 * @changing_leb: %1 if the atomic LEB change ioctl command is in progress 231 * @changing_leb: %1 if the atomic LEB change ioctl command is in progress
232 * @direct_writes: %1 if direct writes are enabled for this volume 232 * @direct_writes: %1 if direct writes are enabled for this volume
233 * 233 *
234 * @gluebi_desc: gluebi UBI volume descriptor
235 * @gluebi_refcount: reference count of the gluebi MTD device
236 * @gluebi_mtd: MTD device description object of the gluebi MTD device
237 *
238 * The @corrupted field indicates that the volume's contents is corrupted. 234 * The @corrupted field indicates that the volume's contents is corrupted.
239 * Since UBI protects only static volumes, this field is not relevant to 235 * Since UBI protects only static volumes, this field is not relevant to
240 * dynamic volumes - it is user's responsibility to assure their data 236 * dynamic volumes - it is user's responsibility to assure their data
@@ -278,17 +274,6 @@ struct ubi_volume {
278 unsigned int updating:1; 274 unsigned int updating:1;
279 unsigned int changing_leb:1; 275 unsigned int changing_leb:1;
280 unsigned int direct_writes:1; 276 unsigned int direct_writes:1;
281
282#ifdef CONFIG_MTD_UBI_GLUEBI
283 /*
284 * Gluebi-related stuff may be compiled out.
285 * Note: this should not be built into UBI but should be a separate
286 * ubimtd driver which works on top of UBI and emulates MTD devices.
287 */
288 struct ubi_volume_desc *gluebi_desc;
289 int gluebi_refcount;
290 struct mtd_info gluebi_mtd;
291#endif
292}; 277};
293 278
294/** 279/**
@@ -517,17 +502,6 @@ int ubi_calc_data_len(const struct ubi_device *ubi, const void *buf,
517int ubi_check_volume(struct ubi_device *ubi, int vol_id); 502int ubi_check_volume(struct ubi_device *ubi, int vol_id);
518void ubi_calculate_reserved(struct ubi_device *ubi); 503void ubi_calculate_reserved(struct ubi_device *ubi);
519 504
520/* gluebi.c */
521#ifdef CONFIG_MTD_UBI_GLUEBI
522int ubi_create_gluebi(struct ubi_device *ubi, struct ubi_volume *vol);
523int ubi_destroy_gluebi(struct ubi_volume *vol);
524void ubi_gluebi_updated(struct ubi_volume *vol);
525#else
526#define ubi_create_gluebi(ubi, vol) 0
527#define ubi_destroy_gluebi(vol) 0
528#define ubi_gluebi_updated(vol)
529#endif
530
531/* eba.c */ 505/* eba.c */
532int ubi_eba_unmap_leb(struct ubi_device *ubi, struct ubi_volume *vol, 506int ubi_eba_unmap_leb(struct ubi_device *ubi, struct ubi_volume *vol,
533 int lnum); 507 int lnum);
diff --git a/drivers/mtd/ubi/vmt.c b/drivers/mtd/ubi/vmt.c
index e151862a3a98..ab64cb56df6e 100644
--- a/drivers/mtd/ubi/vmt.c
+++ b/drivers/mtd/ubi/vmt.c
@@ -317,10 +317,6 @@ int ubi_create_volume(struct ubi_device *ubi, struct ubi_mkvol_req *req)
317 goto out_mapping; 317 goto out_mapping;
318 } 318 }
319 319
320 err = ubi_create_gluebi(ubi, vol);
321 if (err)
322 goto out_cdev;
323
324 vol->dev.release = vol_release; 320 vol->dev.release = vol_release;
325 vol->dev.parent = &ubi->dev; 321 vol->dev.parent = &ubi->dev;
326 vol->dev.devt = dev; 322 vol->dev.devt = dev;
@@ -330,7 +326,7 @@ int ubi_create_volume(struct ubi_device *ubi, struct ubi_mkvol_req *req)
330 err = device_register(&vol->dev); 326 err = device_register(&vol->dev);
331 if (err) { 327 if (err) {
332 ubi_err("cannot register device"); 328 ubi_err("cannot register device");
333 goto out_gluebi; 329 goto out_cdev;
334 } 330 }
335 331
336 err = volume_sysfs_init(ubi, vol); 332 err = volume_sysfs_init(ubi, vol);
@@ -375,10 +371,6 @@ out_sysfs:
375 do_free = 0; 371 do_free = 0;
376 get_device(&vol->dev); 372 get_device(&vol->dev);
377 volume_sysfs_close(vol); 373 volume_sysfs_close(vol);
378out_gluebi:
379 if (ubi_destroy_gluebi(vol))
380 dbg_err("cannot destroy gluebi for volume %d:%d",
381 ubi->ubi_num, vol_id);
382out_cdev: 374out_cdev:
383 cdev_del(&vol->cdev); 375 cdev_del(&vol->cdev);
384out_mapping: 376out_mapping:
@@ -433,10 +425,6 @@ int ubi_remove_volume(struct ubi_volume_desc *desc, int no_vtbl)
433 ubi->volumes[vol_id] = NULL; 425 ubi->volumes[vol_id] = NULL;
434 spin_unlock(&ubi->volumes_lock); 426 spin_unlock(&ubi->volumes_lock);
435 427
436 err = ubi_destroy_gluebi(vol);
437 if (err)
438 goto out_err;
439
440 if (!no_vtbl) { 428 if (!no_vtbl) {
441 err = ubi_change_vtbl_record(ubi, vol_id, NULL); 429 err = ubi_change_vtbl_record(ubi, vol_id, NULL);
442 if (err) 430 if (err)
@@ -674,10 +662,6 @@ int ubi_add_volume(struct ubi_device *ubi, struct ubi_volume *vol)
674 return err; 662 return err;
675 } 663 }
676 664
677 err = ubi_create_gluebi(ubi, vol);
678 if (err)
679 goto out_cdev;
680
681 vol->dev.release = vol_release; 665 vol->dev.release = vol_release;
682 vol->dev.parent = &ubi->dev; 666 vol->dev.parent = &ubi->dev;
683 vol->dev.devt = dev; 667 vol->dev.devt = dev;
@@ -685,12 +669,11 @@ int ubi_add_volume(struct ubi_device *ubi, struct ubi_volume *vol)
685 dev_set_name(&vol->dev, "%s_%d", ubi->ubi_name, vol->vol_id); 669 dev_set_name(&vol->dev, "%s_%d", ubi->ubi_name, vol->vol_id);
686 err = device_register(&vol->dev); 670 err = device_register(&vol->dev);
687 if (err) 671 if (err)
688 goto out_gluebi; 672 goto out_cdev;
689 673
690 err = volume_sysfs_init(ubi, vol); 674 err = volume_sysfs_init(ubi, vol);
691 if (err) { 675 if (err) {
692 cdev_del(&vol->cdev); 676 cdev_del(&vol->cdev);
693 err = ubi_destroy_gluebi(vol);
694 volume_sysfs_close(vol); 677 volume_sysfs_close(vol);
695 return err; 678 return err;
696 } 679 }
@@ -699,8 +682,6 @@ int ubi_add_volume(struct ubi_device *ubi, struct ubi_volume *vol)
699 dbg_err("check failed while adding volume %d", vol_id); 682 dbg_err("check failed while adding volume %d", vol_id);
700 return err; 683 return err;
701 684
702out_gluebi:
703 err = ubi_destroy_gluebi(vol);
704out_cdev: 685out_cdev:
705 cdev_del(&vol->cdev); 686 cdev_del(&vol->cdev);
706 return err; 687 return err;
@@ -716,12 +697,9 @@ out_cdev:
716 */ 697 */
717void ubi_free_volume(struct ubi_device *ubi, struct ubi_volume *vol) 698void ubi_free_volume(struct ubi_device *ubi, struct ubi_volume *vol)
718{ 699{
719 int err;
720
721 dbg_gen("free volume %d", vol->vol_id); 700 dbg_gen("free volume %d", vol->vol_id);
722 701
723 ubi->volumes[vol->vol_id] = NULL; 702 ubi->volumes[vol->vol_id] = NULL;
724 err = ubi_destroy_gluebi(vol);
725 cdev_del(&vol->cdev); 703 cdev_del(&vol->cdev);
726 volume_sysfs_close(vol); 704 volume_sysfs_close(vol);
727} 705}