aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/ubi/gluebi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/ubi/gluebi.c')
-rw-r--r--drivers/mtd/ubi/gluebi.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/drivers/mtd/ubi/gluebi.c b/drivers/mtd/ubi/gluebi.c
index cb7c075f2144..1cb287ec32ad 100644
--- a/drivers/mtd/ubi/gluebi.c
+++ b/drivers/mtd/ubi/gluebi.c
@@ -99,9 +99,6 @@ static int gluebi_get_device(struct mtd_info *mtd)
99 struct gluebi_device *gluebi; 99 struct gluebi_device *gluebi;
100 int ubi_mode = UBI_READONLY; 100 int ubi_mode = UBI_READONLY;
101 101
102 if (!try_module_get(THIS_MODULE))
103 return -ENODEV;
104
105 if (mtd->flags & MTD_WRITEABLE) 102 if (mtd->flags & MTD_WRITEABLE)
106 ubi_mode = UBI_READWRITE; 103 ubi_mode = UBI_READWRITE;
107 104
@@ -129,7 +126,6 @@ static int gluebi_get_device(struct mtd_info *mtd)
129 ubi_mode); 126 ubi_mode);
130 if (IS_ERR(gluebi->desc)) { 127 if (IS_ERR(gluebi->desc)) {
131 mutex_unlock(&devices_mutex); 128 mutex_unlock(&devices_mutex);
132 module_put(THIS_MODULE);
133 return PTR_ERR(gluebi->desc); 129 return PTR_ERR(gluebi->desc);
134 } 130 }
135 gluebi->refcnt += 1; 131 gluebi->refcnt += 1;
@@ -153,7 +149,6 @@ static void gluebi_put_device(struct mtd_info *mtd)
153 gluebi->refcnt -= 1; 149 gluebi->refcnt -= 1;
154 if (gluebi->refcnt == 0) 150 if (gluebi->refcnt == 0)
155 ubi_close_volume(gluebi->desc); 151 ubi_close_volume(gluebi->desc);
156 module_put(THIS_MODULE);
157 mutex_unlock(&devices_mutex); 152 mutex_unlock(&devices_mutex);
158} 153}
159 154