Lines Matching refs:mtdinfo
63 struct mtd_info *mtdinfo; member
163 (*curmtd)->mtdinfo = kmalloc(sizeof(struct mtd_info), GFP_KERNEL); in register_device()
166 if ((*curmtd)->mtdinfo) { in register_device()
167 memset((char *)(*curmtd)->mtdinfo, 0, sizeof(struct mtd_info)); in register_device()
168 (*curmtd)->mtdinfo->priv = in register_device()
171 if (!(*curmtd)->mtdinfo->priv) { in register_device()
172 kfree((*curmtd)->mtdinfo); in register_device()
173 (*curmtd)->mtdinfo = NULL; in register_device()
175 memset((*curmtd)->mtdinfo->priv,0,sizeof(slram_priv_t)); in register_device()
179 if (!(*curmtd)->mtdinfo) { in register_device()
184 if (!(((slram_priv_t *)(*curmtd)->mtdinfo->priv)->start = in register_device()
189 ((slram_priv_t *)(*curmtd)->mtdinfo->priv)->end = in register_device()
190 ((slram_priv_t *)(*curmtd)->mtdinfo->priv)->start + length; in register_device()
193 (*curmtd)->mtdinfo->name = name; in register_device()
194 (*curmtd)->mtdinfo->size = length; in register_device()
195 (*curmtd)->mtdinfo->flags = MTD_CLEAR_BITS | MTD_SET_BITS | in register_device()
197 (*curmtd)->mtdinfo->erase = slram_erase; in register_device()
198 (*curmtd)->mtdinfo->point = slram_point; in register_device()
199 (*curmtd)->mtdinfo->unpoint = slram_unpoint; in register_device()
200 (*curmtd)->mtdinfo->read = slram_read; in register_device()
201 (*curmtd)->mtdinfo->write = slram_write; in register_device()
202 (*curmtd)->mtdinfo->module = THIS_MODULE; in register_device()
203 (*curmtd)->mtdinfo->type = MTD_RAM; in register_device()
204 (*curmtd)->mtdinfo->erasesize = 0x0; in register_device()
206 if (add_mtd_device((*curmtd)->mtdinfo)) { in register_device()
208 iounmap(((slram_priv_t *)(*curmtd)->mtdinfo->priv)->start); in register_device()
209 kfree((*curmtd)->mtdinfo->priv); in register_device()
210 kfree((*curmtd)->mtdinfo); in register_device()
216 ((slram_priv_t *)(*curmtd)->mtdinfo->priv)->start, in register_device()
217 ((slram_priv_t *)(*curmtd)->mtdinfo->priv)->end); in register_device()
227 del_mtd_device(slram_mtdlist->mtdinfo); in unregister_devices()
228 iounmap(((slram_priv_t *)slram_mtdlist->mtdinfo->priv)->start); in unregister_devices()
229 kfree(slram_mtdlist->mtdinfo->priv); in unregister_devices()
230 kfree(slram_mtdlist->mtdinfo); in unregister_devices()