Lines Matching defs:classdev

25 /* This is a private structure used to tie the classdev and the
30 struct device classdev;
37 get_device(&ic->classdev);
44 put_device(&ic->classdev);
49 * attribute_container_classdev_to_container - given a classdev, return the container
51 * @classdev: the class device created by attribute_container_add_device.
53 * Returns the container associated with this classdev.
56 attribute_container_classdev_to_container(struct device *classdev)
59 container_of(classdev, struct internal_container, classdev);
113 static void attribute_container_release(struct device *classdev)
116 = container_of(classdev, struct internal_container, classdev);
117 struct device *dev = classdev->parent;
134 * might be necessary is to allocate and initialise the classdev and
139 * which is not relinquished until the release of the classdev.
166 device_initialize(&ic->classdev);
167 ic->classdev.parent = get_device(dev);
168 ic->classdev.class = cont->class;
170 dev_set_name(&ic->classdev, dev_name(dev));
172 fn(cont, dev, &ic->classdev);
174 attribute_container_add_class_device(&ic->classdev);
199 * still has a reference to the classdev, then the memory occupied
200 * will not be freed until the classdev is released). If you want a
204 * to do the final put on the classdev.
226 if (dev != ic->classdev.parent)
230 fn(cont, dev, &ic->classdev);
232 attribute_container_remove_attrs(&ic->classdev);
233 device_unregister(&ic->classdev);
241 * attribute_container_device_trigger - execute a trigger for each matching classdev
244 * @fn the function to execute for each classdev.
247 * the container and the classdev. If you only care about the
272 if (dev == ic->classdev.parent)
273 fn(cont, dev, &ic->classdev);
286 * matching containers (not the classdev) associated with a device.
289 * actually needs to know the classdev.
309 * @classdev: The class device
315 attribute_container_add_attrs(struct device *classdev)
318 attribute_container_classdev_to_container(classdev);
328 return sysfs_create_group(&classdev->kobj, cont->grp);
332 error = device_create_file(classdev, attrs[i]);
343 * @classdev: the class device to add
346 * attribute containers, namely add the classdev to the system and then
350 attribute_container_add_class_device(struct device *classdev)
352 int error = device_add(classdev);
355 return attribute_container_add_attrs(classdev);
367 struct device *classdev)
369 return attribute_container_add_class_device(classdev);
375 * @classdev: The class device to remove the files from
379 attribute_container_remove_attrs(struct device *classdev)
382 attribute_container_classdev_to_container(classdev);
390 sysfs_remove_group(&classdev->kobj, cont->grp);
395 device_remove_file(classdev, attrs[i]);
401 * @classdev: the class device
407 attribute_container_class_device_del(struct device *classdev)
409 attribute_container_remove_attrs(classdev);
410 device_del(classdev);
431 if (ic->classdev.parent == dev) {
432 cdev = &ic->classdev;