Lines Matching refs:sub
45 struct bttv_sub_driver *sub = to_bttv_sub_drv(drv); in bttv_sub_bus_match() local
46 int len = strlen(sub->wanted); in bttv_sub_bus_match()
48 if (0 == strncmp(dev_name(dev), sub->wanted, len)) in bttv_sub_bus_match()
56 struct bttv_sub_driver *sub = to_bttv_sub_drv(dev->driver); in bttv_sub_probe() local
58 return sub->probe ? sub->probe(sdev) : -ENODEV; in bttv_sub_probe()
64 struct bttv_sub_driver *sub = to_bttv_sub_drv(dev->driver); in bttv_sub_remove() local
66 if (sub->remove) in bttv_sub_remove()
67 sub->remove(sdev); in bttv_sub_remove()
80 struct bttv_sub_device *sub = to_bttv_sub_dev(dev); in release_sub_device() local
81 kfree(sub); in release_sub_device()
86 struct bttv_sub_device *sub; in bttv_sub_add_device() local
89 sub = kzalloc(sizeof(*sub),GFP_KERNEL); in bttv_sub_add_device()
90 if (NULL == sub) in bttv_sub_add_device()
93 sub->core = core; in bttv_sub_add_device()
94 sub->dev.parent = &core->pci->dev; in bttv_sub_add_device()
95 sub->dev.bus = &bttv_sub_bus_type; in bttv_sub_add_device()
96 sub->dev.release = release_sub_device; in bttv_sub_add_device()
97 dev_set_name(&sub->dev, "%s%d", name, core->nr); in bttv_sub_add_device()
99 err = device_register(&sub->dev); in bttv_sub_add_device()
101 put_device(&sub->dev); in bttv_sub_add_device()
104 pr_info("%d: add subdevice \"%s\"\n", core->nr, dev_name(&sub->dev)); in bttv_sub_add_device()
105 list_add_tail(&sub->list,&core->subs); in bttv_sub_add_device()
111 struct bttv_sub_device *sub, *save; in bttv_sub_del_devices() local
113 list_for_each_entry_safe(sub, save, &core->subs, list) { in bttv_sub_del_devices()
114 list_del(&sub->list); in bttv_sub_del_devices()
115 device_unregister(&sub->dev); in bttv_sub_del_devices()
123 int bttv_sub_register(struct bttv_sub_driver *sub, char *wanted) in bttv_sub_register() argument
125 sub->drv.bus = &bttv_sub_bus_type; in bttv_sub_register()
126 snprintf(sub->wanted,sizeof(sub->wanted),"%s",wanted); in bttv_sub_register()
127 return driver_register(&sub->drv); in bttv_sub_register()
131 int bttv_sub_unregister(struct bttv_sub_driver *sub) in bttv_sub_unregister() argument
133 driver_unregister(&sub->drv); in bttv_sub_unregister()