Lines Matching full:up
52 struct uflash_dev *up; in uflash_devinit() local
64 up = kzalloc(sizeof(struct uflash_dev), GFP_KERNEL); in uflash_devinit()
65 if (!up) in uflash_devinit()
69 memcpy(&up->map, &uflash_map_templ, sizeof(uflash_map_templ)); in uflash_devinit()
71 up->map.size = resource_size(&op->resource[0]); in uflash_devinit()
73 up->name = of_get_property(dp, "model", NULL); in uflash_devinit()
74 if (up->name && 0 < strlen(up->name)) in uflash_devinit()
75 up->map.name = up->name; in uflash_devinit()
77 up->map.phys = op->resource[0].start; in uflash_devinit()
79 up->map.virt = of_ioremap(&op->resource[0], 0, up->map.size, in uflash_devinit()
81 if (!up->map.virt) { in uflash_devinit()
83 kfree(up); in uflash_devinit()
88 simple_map_init(&up->map); in uflash_devinit()
91 up->mtd = do_map_probe("cfi_probe", &up->map); in uflash_devinit()
92 if (!up->mtd) { in uflash_devinit()
93 of_iounmap(&op->resource[0], up->map.virt, up->map.size); in uflash_devinit()
94 kfree(up); in uflash_devinit()
99 up->mtd->owner = THIS_MODULE; in uflash_devinit()
101 mtd_device_register(up->mtd, NULL, 0); in uflash_devinit()
103 dev_set_drvdata(&op->dev, up); in uflash_devinit()
123 struct uflash_dev *up = dev_get_drvdata(&op->dev); in uflash_remove() local
125 if (up->mtd) { in uflash_remove()
126 mtd_device_unregister(up->mtd); in uflash_remove()
127 map_destroy(up->mtd); in uflash_remove()
129 if (up->map.virt) { in uflash_remove()
130 of_iounmap(&op->resource[0], up->map.virt, up->map.size); in uflash_remove()
131 up->map.virt = NULL; in uflash_remove()
134 kfree(up); in uflash_remove()