• Home
  • Raw
  • Download

Lines Matching refs:cur

154 	struct bsr_dev *cur, *n;  in bsr_cleanup_devs()  local
156 list_for_each_entry_safe(cur, n, &bsr_devs, bsr_list) { in bsr_cleanup_devs()
157 if (cur->bsr_device) { in bsr_cleanup_devs()
158 cdev_del(&cur->bsr_cdev); in bsr_cleanup_devs()
159 device_del(cur->bsr_device); in bsr_cleanup_devs()
161 list_del(&cur->bsr_list); in bsr_cleanup_devs()
162 kfree(cur); in bsr_cleanup_devs()
186 struct bsr_dev *cur = kzalloc(sizeof(struct bsr_dev), in bsr_add_node() local
191 if (!cur) { in bsr_add_node()
200 kfree(cur); in bsr_add_node()
204 cur->bsr_minor = i + total_bsr_devs; in bsr_add_node()
205 cur->bsr_addr = res.start; in bsr_add_node()
206 cur->bsr_len = resource_size(&res); in bsr_add_node()
207 cur->bsr_bytes = bsr_bytes[i]; in bsr_add_node()
208 cur->bsr_stride = bsr_stride[i]; in bsr_add_node()
209 cur->bsr_dev = MKDEV(bsr_major, i + total_bsr_devs); in bsr_add_node()
213 if (cur->bsr_len > 4096 && cur->bsr_len < PAGE_SIZE) in bsr_add_node()
214 cur->bsr_len = 4096; in bsr_add_node()
216 switch(cur->bsr_bytes) { in bsr_add_node()
218 cur->bsr_type = BSR_8; in bsr_add_node()
221 cur->bsr_type = BSR_16; in bsr_add_node()
224 cur->bsr_type = BSR_64; in bsr_add_node()
227 cur->bsr_type = BSR_128; in bsr_add_node()
230 cur->bsr_type = BSR_4096; in bsr_add_node()
233 cur->bsr_type = BSR_UNKNOWN; in bsr_add_node()
236 cur->bsr_num = bsr_types[cur->bsr_type]; in bsr_add_node()
237 snprintf(cur->bsr_name, 32, "bsr%d_%d", in bsr_add_node()
238 cur->bsr_bytes, cur->bsr_num); in bsr_add_node()
240 cdev_init(&cur->bsr_cdev, &bsr_fops); in bsr_add_node()
241 result = cdev_add(&cur->bsr_cdev, cur->bsr_dev, 1); in bsr_add_node()
243 kfree(cur); in bsr_add_node()
247 cur->bsr_device = device_create(bsr_class, NULL, cur->bsr_dev, in bsr_add_node()
248 cur, "%s", cur->bsr_name); in bsr_add_node()
249 if (IS_ERR(cur->bsr_device)) { in bsr_add_node()
251 cur->bsr_name); in bsr_add_node()
252 cdev_del(&cur->bsr_cdev); in bsr_add_node()
253 kfree(cur); in bsr_add_node()
257 bsr_types[cur->bsr_type] = cur->bsr_num + 1; in bsr_add_node()
258 list_add_tail(&cur->bsr_list, &bsr_devs); in bsr_add_node()