search for: sysfs_create_group

Displaying 20 results from an estimated 92 matches for "sysfs_create_group".

2016 Feb 20
0
[PATCH v4 5/6] hwmon: don't require therm to be valid to get any data
...wmon_device_register(&dev->pdev->dev); if (IS_ERR(hwmon_dev)) { ret = PTR_ERR(hwmon_dev); @@ -659,26 +656,28 @@ nouveau_hwmon_init(struct drm_device *dev) if (ret) goto error; - /* if the card has a working thermal sensor */ - if (nvkm_therm_temp_get(therm) >= 0) { - ret = sysfs_create_group(&hwmon_dev->kobj, &hwmon_temp_attrgroup); - if (ret) - goto error; - } - - /* if the card has a pwm fan */ - /*XXX: incorrect, need better detection for this, some boards have - * the gpio entries for pwm fan control even when there's no - * actual fan connected to it......
2016 Aug 18
1
[PATCH 11/15] zram: Pass attribute group to device_add_disk
...gt; zram->disk->queue->limits.discard_zeroes_data = 0; > queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, zram->disk->queue); > > - device_add_disk(NULL, zram->disk, NULL); > + ret = device_add_disk(NULL, zram->disk, &zram_disk_attr_group); > > - ret = sysfs_create_group(&disk_to_dev(zram->disk)->kobj, > - &zram_disk_attr_group); > if (ret < 0) { > - pr_err("Error creating sysfs group for device %d\n", > - device_id); > + pr_err("Error creating disk %d\n", device_id); > goto out_free_disk; > }...
2016 Aug 18
1
[PATCH 11/15] zram: Pass attribute group to device_add_disk
...gt; zram->disk->queue->limits.discard_zeroes_data = 0; > queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, zram->disk->queue); > > - device_add_disk(NULL, zram->disk, NULL); > + ret = device_add_disk(NULL, zram->disk, &zram_disk_attr_group); > > - ret = sysfs_create_group(&disk_to_dev(zram->disk)->kobj, > - &zram_disk_attr_group); > if (ret < 0) { > - pr_err("Error creating sysfs group for device %d\n", > - device_id); > + pr_err("Error creating disk %d\n", device_id); > goto out_free_disk; > }...
2016 Oct 25
1
[PATCH 3/3] hwmon: expose power_max and power_crit
...mon_power_caps_attrgroup = { > + .attrs = hwmon_power_caps_attributes, > +}; > #endif > > int > @@ -728,8 +763,16 @@ nouveau_hwmon_init(struct drm_device *dev) > if (iccsense && iccsense->data_valid && !list_empty(&iccsense->rails)) { > ret = sysfs_create_group(&hwmon_dev->kobj, > &hwmon_power_attrgroup); > + > if (ret) > goto error; > + > + if (iccsense->power_w_max && iccsense->power_w_crit) { > + ret = sysfs_create_group(&hwmon_dev->kobj, > + &hwmon_power_caps_attrgroup)...
2017 Apr 26
0
[PATCH v5 3/5] nouveau_hwmon: Remove old code, add .write/.read operations
...t;dev, "nouveau", dev, + &nouveau_chip_info, NULL); if (IS_ERR(hwmon_dev)) { ret = PTR_ERR(hwmon_dev); NV_ERROR(drm, "Unable to register hwmon device: %d\n", ret); return ret; } - dev_set_drvdata(hwmon_dev, dev); - - /* set the default attributes */ - ret = sysfs_create_group(&hwmon_dev->kobj, &hwmon_default_attrgroup); - if (ret) - goto error; - - if (therm && therm->attr_get && therm->attr_set) { - /* if the card has a working thermal sensor */ - if (nvkm_therm_temp_get(therm) >= 0) { - ret = sysfs_create_group(&hwmon_dev-&...
2017 Apr 13
0
[PATCH 2/4] nouveau_hwmon: migrate to hwmon_device_register_with_info
...t;dev, "nouveau", dev, + &nouveau_chip_info, NULL); if (IS_ERR(hwmon_dev)) { ret = PTR_ERR(hwmon_dev); NV_ERROR(drm, "Unable to register hwmon device: %d\n", ret); return ret; } - dev_set_drvdata(hwmon_dev, dev); - - /* set the default attributes */ - ret = sysfs_create_group(&hwmon_dev->kobj, &hwmon_default_attrgroup); - if (ret) - goto error; - - if (therm && therm->attr_get && therm->attr_set) { - /* if the card has a working thermal sensor */ - if (nvkm_therm_temp_get(therm) >= 0) { - ret = sysfs_create_group(&hwmon_dev-&...
2017 Apr 11
2
[PATCH 1/1] nouveau_hwmon: migrate to hwmon_device_register_with_info
...t;nouveau", dev, + &nouveau_chip_info, special_groups); + if (IS_ERR(hwmon_dev)) { ret = PTR_ERR(hwmon_dev); NV_ERROR(drm, "Unable to register hwmon device: %d\n", ret); return ret; } - dev_set_drvdata(hwmon_dev, dev); - - /* set the default attributes */ - ret = sysfs_create_group(&hwmon_dev->kobj, &hwmon_default_attrgroup); - if (ret) - goto error; - - if (therm && therm->attr_get && therm->attr_set) { - /* if the card has a working thermal sensor */ - if (nvkm_therm_temp_get(therm) >= 0) { - ret = sysfs_create_group(&hwmon_dev-&...
2016 Oct 24
0
[PATCH 3/3] hwmon: expose power_max and power_crit
...static const struct attribute_group hwmon_power_caps_attrgroup = { + .attrs = hwmon_power_caps_attributes, +}; #endif int @@ -728,8 +763,16 @@ nouveau_hwmon_init(struct drm_device *dev) if (iccsense && iccsense->data_valid && !list_empty(&iccsense->rails)) { ret = sysfs_create_group(&hwmon_dev->kobj, &hwmon_power_attrgroup); + if (ret) goto error; + + if (iccsense->power_w_max && iccsense->power_w_crit) { + ret = sysfs_create_group(&hwmon_dev->kobj, + &hwmon_power_caps_attrgroup); + if (ret) + goto error; + } }...
2013 Aug 12
1
[PATCH v2 1/7] Intel MIC Host Driver for X100 family.
...ev, > + MKDEV(MAJOR(g_mic.mdev_id), mdev->id), NULL, "%s", mdev->name); > + if (IS_ERR(mdev->sdev)) { > + rc = PTR_ERR(mdev->sdev); > + dev_err(&pdev->dev, "device_create failed rc %d\n", rc); > + goto unmap_aper; > + } > + > + rc = sysfs_create_group(&mdev->sdev->kobj, &mdev->attr_group); We now have a function you should use instead, device_create_with_groups() that solves the race condition you just caused here by creating and notifying userspace that the device is present, _before_ creating the sysfs files for it. > +...
2013 Aug 12
1
[PATCH v2 1/7] Intel MIC Host Driver for X100 family.
...ev, > + MKDEV(MAJOR(g_mic.mdev_id), mdev->id), NULL, "%s", mdev->name); > + if (IS_ERR(mdev->sdev)) { > + rc = PTR_ERR(mdev->sdev); > + dev_err(&pdev->dev, "device_create failed rc %d\n", rc); > + goto unmap_aper; > + } > + > + rc = sysfs_create_group(&mdev->sdev->kobj, &mdev->attr_group); We now have a function you should use instead, device_create_with_groups() that solves the race condition you just caused here by creating and notifying userspace that the device is present, _before_ creating the sysfs files for it. > +...
2017 Apr 26
9
[PATCH v5 0/5] replace hwmon_device_register for hwmon_device_register_with_info
This v5 drops a check for attr_set. Versions: v1 -> v2: * Keep temp attrs as read only v2 -> v3: * Code fix-ups: struct and string as const and add return within switch due to fallthrough * Add Signed-off-by to all commits v3 -> v4: * Rever const to struct attribute. Kbuild complains. v4 -> v5: * Drops a check for attr_set in
2017 Apr 12
0
[PATCH 1/1] nouveau_hwmon: migrate to hwmon_device_register_with_info
...ret = PTR_ERR(hwmon_dev); > NV_ERROR(drm, "Unable to register hwmon device: %d\n", ret); > return ret; > } > - dev_set_drvdata(hwmon_dev, dev); > - > - /* set the default attributes */ > - ret = sysfs_create_group(&hwmon_dev->kobj, &hwmon_default_attrgroup); > - if (ret) > - goto error; > - > - if (therm && therm->attr_get && therm->attr_set) { > - /* if the card has a working thermal sensor */ > - if (nv...
2014 Jan 12
3
[PATCH net-next v2 4/4] virtio-net: initial debugfs support, export mergeable rx buffer size
...attribute group containing the mergeable_rx_buffer_size attribute in virtio-net, and initialize the per-netdevice group pointer to the address of this group in virtnet_probe before register_netdevice (3) In net-sysfs, modify net_rx_queue_update_kobjects (or rx_queue_add_kobject) to call sysfs_create_group on the per-netdev attribute group (if non-NULL), adding the attributes in the group to the RX queue kobject. That should allow us to have per-RX queue attributes that are device-specific. I'm not a sysfs expert, but it seems that rx_queue_ktype and rx_queue_sysfs_ops presume that all r...
2014 Jan 12
3
[PATCH net-next v2 4/4] virtio-net: initial debugfs support, export mergeable rx buffer size
...attribute group containing the mergeable_rx_buffer_size attribute in virtio-net, and initialize the per-netdevice group pointer to the address of this group in virtnet_probe before register_netdevice (3) In net-sysfs, modify net_rx_queue_update_kobjects (or rx_queue_add_kobject) to call sysfs_create_group on the per-netdev attribute group (if non-NULL), adding the attributes in the group to the RX queue kobject. That should allow us to have per-RX queue attributes that are device-specific. I'm not a sysfs expert, but it seems that rx_queue_ktype and rx_queue_sysfs_ops presume that all r...
2016 Feb 20
12
[PATCH v4 0/6] Suppor for various power sensors on GF100+
This is a complete rework from the first version I sent out. Now the implementation is more centered around the power_rails we find in the SENSE table instead of extdev centered. This makes the implementation a lot easier and straightforward. I've added support for the INA219, INA209 and INA3221 sensors found on multiple Fermi and Kepler cards. The power consumption is also exported via
2017 May 08
5
[PATCH v6 0/5] replace hwmon_device_register for hwmon_device_register_with_info
This v6 fixes some comments pointed out by Martin Peres. Versions: v1 -> v2: * Keep temp attrs as read only v2 -> v3: * Code fix-ups: struct and string as const and add return within switch due to fallthrough * Add Signed-off-by to all commits v3 -> v4: * Rever const to struct attribute. Kbuild complains. v4 -> v5: * Drops a check for
2017 Apr 22
6
[PATCH v4 0/5] replace hwmon_device_register for hwmon_device_register_with_info
Kbuild sent me an e-mail due to a fixup I introduced in v3. It complains due to an incompatible pointer type and it doesn't build. This version reverts it. Versions: v1 -> v2: * Keep temp attrs as read only v2 -> v3: * Code fix-ups: struct and string as const and add return within switch due to fallthrough * Add Signed-off-by to all commits v3 -> v4:
2017 Apr 21
6
[PATCH v3 0/5] replace hwmon_device_register for hwmon_device_register_with_info
Hi, this is version v3 with some fix-ups: Versions: v1 -> v2: * Keep temp attrs as read only v2 -> v3: * Code fix-ups: struct and string as const and add return within switch due to fallthrough * Add Signed-off-by to all commits This patchseries replaces the deprecated hwmon_device_register function with the new one hwmon_device_register_with_info. It also does some cleanup. Here
2017 May 18
7
[PATCH v8 0/5] replace hwmon_device_register for hwmon_device_register_with_info
This v8 fixes removes dummy functions which only had a return and moves the code into the switch statements. Versions: v1 -> v2: * Keep temp attrs as read only v2 -> v3: * Code fix-ups: struct and string as const and add return within switch due to fallthrough * Add Signed-off-by to all commits v3 -> v4: * Rever const to struct attribute. Kbuild
2017 May 16
7
[PATCH v7 0/5] replace hwmon_device_register for hwmon_device_register_with_info
This v7 fixes removes dummy functions which only had a return and moves the code into the switch statements. Versions: v1 -> v2: * Keep temp attrs as read only v2 -> v3: * Code fix-ups: struct and string as const and add return within switch due to fallthrough * Add Signed-off-by to all commits v3 -> v4: * Rever const to struct attribute. Kbuild