Lines Matching defs:class
374 static struct class devlink_class = {
463 .class = &devlink_class,
666 link->link_dev.class = &devlink_class;
1416 if (dev->class == &devlink_class)
1682 * so be careful about accessing it. dev->bus and dev->class should
1834 else if (dev->class && dev->class->dev_release)
1835 dev->class->dev_release(dev);
1847 if (dev->class && dev->class->ns_type)
1848 ns = dev->class->namespace(dev);
1857 if (dev->class && dev->class->get_ownership)
1858 dev->class->get_ownership(dev, uid, gid);
1877 if (dev->class)
1889 if (dev->class)
1890 return dev->class->name;
1945 /* have the class specific function add its stuff */
1946 if (dev->class && dev->class->dev_uevent) {
1947 retval = dev->class->dev_uevent(dev, env);
1949 pr_debug("device: '%s': %s: class uevent() "
2226 struct class *class = dev->class;
2230 if (class) {
2231 error = device_add_groups(dev, class->dev_groups);
2276 if (class)
2277 device_remove_groups(dev, class->dev_groups);
2284 struct class *class = dev->class;
2295 if (class)
2296 device_remove_groups(dev, class->dev_groups);
2512 struct class *class;
2527 return dir->class->ns_type;
2537 class_dir_create_and_add(struct class *class, struct kobject *parent_kobj)
2546 dir->class = class;
2549 dir->kobj.kset = &class->p->glue_dirs;
2551 retval = kobject_add(&dir->kobj, parent_kobj, "%s", class->name);
2564 if (dev->class) {
2571 if (sysfs_deprecated && dev->class == &block_class) {
2572 if (parent && parent->class == &block_class)
2580 * Class-devices with a non class-device as parent, live
2585 else if (parent->class && !dev->class->ns_type)
2592 /* find our class-directory at the parent and reference it */
2593 spin_lock(&dev->class->p->glue_dirs.list_lock);
2594 list_for_each_entry(k, &dev->class->p->glue_dirs.list, entry)
2599 spin_unlock(&dev->class->p->glue_dirs.list_lock);
2605 /* or create a new class-directory at the parent device */
2606 k = class_dir_create_and_add(dev->class, parent_kobj);
2624 if (!kobj || !dev->class ||
2625 kobj->kset != &dev->class->p->glue_dirs)
2716 if (!dev->class)
2720 &dev->class->p->subsys.kobj,
2734 if (sysfs_deprecated && dev->class == &block_class)
2738 /* link in the class directory pointing to the device */
2739 error = sysfs_create_link(&dev->class->p->subsys.kobj,
2761 if (!dev->class)
2768 if (sysfs_deprecated && dev->class == &block_class)
2771 sysfs_delete_link(&dev->class->p->subsys.kobj, &dev->kobj, dev_name(dev));
2795 * By default we select char/ for new entries. Setting class->dev_obj
2796 * to NULL prevents an entry from being created. class->dev_kobj must
2797 * be set (or cleared) before any devices are registered to the class
2806 if (dev->class)
2807 kobj = dev->class->dev_kobj;
3004 if (dev->class) {
3005 mutex_lock(&dev->class->p->mutex);
3006 /* tie the class to the device */
3008 &dev->class->p->klist_devices);
3012 &dev->class->p->interfaces, node)
3015 mutex_unlock(&dev->class->p->mutex);
3108 * to run while we are tearing out the bus/class/sysfs from
3163 if (dev->class) {
3166 mutex_lock(&dev->class->p->mutex);
3169 &dev->class->p->interfaces, node)
3172 /* remove the device from the class list */
3174 mutex_unlock(&dev->class->p->mutex);
3269 /* the class may provide a specific name */
3270 if (dev->class && dev->class->devnode)
3271 *tmp = dev->class->devnode(dev, mode);
3620 device_create_groups_vargs(struct class *class, struct device *parent,
3628 if (class == NULL || IS_ERR(class))
3639 dev->class = class;
3662 * @class: pointer to the struct class that this device should be registered to
3669 * will be created in sysfs, registered to the specified class.
3681 * Note: the struct class passed to this function must have previously
3684 struct device *device_create(struct class *class, struct device *parent,
3691 dev = device_create_groups_vargs(class, parent, devt, drvdata, NULL,
3700 * @class: pointer to the struct class that this device should be registered to
3708 * will be created in sysfs, registered to the specified class.
3722 * Note: the struct class passed to this function must have previously
3725 struct device *device_create_with_groups(struct class *class,
3735 dev = device_create_groups_vargs(class, parent, devt, drvdata, groups,
3744 * @class: pointer to the struct class that this device was registered with
3750 void device_destroy(struct class *class, dev_t devt)
3754 dev = class_find_device_by_devt(class, devt);
3819 if (dev->class) {
3820 error = sysfs_rename_link_ns(&dev->class->p->subsys.kobj,
3898 if (dev->class) {
3947 struct class *class = dev->class;
3951 if (class) {
3953 * Change the device groups of the device class for @dev to
3956 error = sysfs_groups_change_owner(kobj, class->dev_groups, kuid,
4030 * device class, and the groups associated with the device type of @dev
4042 if (sysfs_deprecated && dev->class == &block_class)
4047 * Change the owner of the symlink located in the class directory of
4048 * the device class associated with @dev which points to the actual
4052 error = sysfs_link_change_owner(&dev->class->p->subsys.kobj, &dev->kobj,
4108 if (dev->class && dev->class->shutdown_pre) {
4111 dev->class->shutdown_pre(dev);
4147 if (dev->class)
4148 subsys = dev->class->name;