Lines Matching refs:cx_dev
52 struct cx_dev *cx_dev = to_cx_dev(dev); in tiocx_match() local
60 if (ids->part_num == cx_dev->cx_id.part_num) in tiocx_match()
86 struct cx_dev *cx_device) in cx_device_match()
114 struct cx_dev *cx_dev = to_cx_dev(dev); in cx_device_probe() local
117 if (!cx_dev->driver && cx_drv->probe) { in cx_device_probe()
118 id = cx_device_match(cx_drv->id_table, cx_dev); in cx_device_probe()
120 if ((error = cx_drv->probe(cx_dev, id)) < 0) in cx_device_probe()
123 cx_dev->driver = cx_drv; in cx_device_probe()
136 struct cx_dev *cx_dev = to_cx_dev(dev); in cx_driver_remove() local
137 struct cx_drv *cx_drv = cx_dev->driver; in cx_driver_remove()
139 cx_drv->remove(cx_dev); in cx_driver_remove()
140 cx_dev->driver = NULL; in cx_driver_remove()
192 struct cx_dev *cx_dev; in cx_device_register() local
195 cx_dev = kzalloc(sizeof(struct cx_dev), GFP_KERNEL); in cx_device_register()
196 DBG("cx_dev= 0x%p\n", cx_dev); in cx_device_register()
197 if (cx_dev == NULL) in cx_device_register()
200 cx_dev->cx_id.part_num = part_num; in cx_device_register()
201 cx_dev->cx_id.mfg_num = mfg_num; in cx_device_register()
202 cx_dev->cx_id.nasid = nasid; in cx_device_register()
203 cx_dev->hubdev = hubdev; in cx_device_register()
204 cx_dev->bt = bt; in cx_device_register()
206 cx_dev->dev.parent = NULL; in cx_device_register()
207 cx_dev->dev.bus = &tiocx_bus_type; in cx_device_register()
208 cx_dev->dev.release = tiocx_bus_release; in cx_device_register()
209 dev_set_name(&cx_dev->dev, "%d", cx_dev->cx_id.nasid); in cx_device_register()
210 r = device_register(&cx_dev->dev); in cx_device_register()
212 kfree(cx_dev); in cx_device_register()
215 get_device(&cx_dev->dev); in cx_device_register()
217 device_create_file(&cx_dev->dev, &dev_attr_cxdev_control); in cx_device_register()
226 int cx_device_unregister(struct cx_dev *cx_dev) in cx_device_unregister() argument
228 put_device(&cx_dev->dev); in cx_device_unregister()
229 device_unregister(&cx_dev->dev); in cx_device_unregister()
242 static int cx_device_reload(struct cx_dev *cx_dev) in cx_device_reload() argument
244 cx_device_unregister(cx_dev); in cx_device_reload()
245 return cx_device_register(cx_dev->cx_id.nasid, cx_dev->cx_id.part_num, in cx_device_reload()
246 cx_dev->cx_id.mfg_num, cx_dev->hubdev, in cx_device_reload()
247 cx_dev->bt); in cx_device_reload()
406 static int tiocx_reload(struct cx_dev *cx_dev) in tiocx_reload() argument
410 nasid_t nasid = cx_dev->cx_id.nasid; in tiocx_reload()
432 cx_dev->cx_id.part_num = part_num; in tiocx_reload()
433 cx_dev->cx_id.mfg_num = mfg_num; in tiocx_reload()
442 return cx_device_reload(cx_dev); in tiocx_reload()
447 struct cx_dev *cx_dev = to_cx_dev(dev); in show_cxdev_control() local
450 cx_dev->cx_id.nasid, in show_cxdev_control()
451 cx_dev->cx_id.part_num, cx_dev->cx_id.mfg_num, in show_cxdev_control()
452 cx_dev->bt); in show_cxdev_control()
459 struct cx_dev *cx_dev = to_cx_dev(dev); in store_cxdev_control() local
471 tio_corelet_reset(cx_dev->cx_id.nasid, TIOCX_CORELET); in store_cxdev_control()
472 tiocx_reload(cx_dev); in store_cxdev_control()
475 tiocx_reload(cx_dev); in store_cxdev_control()
478 tio_corelet_reset(cx_dev->cx_id.nasid, TIOCX_CORELET); in store_cxdev_control()
543 struct cx_dev *cx_dev = to_cx_dev(dev); in cx_remove_device() local
545 cx_device_unregister(cx_dev); in cx_remove_device()