int dpm_sysfs_add(struct device *dev) { int rc; rc = sysfs_create_group(&dev->kobj, &pm_attr_group); if (rc) return rc; if (pm_runtime_callbacks_present(dev)) { rc = sysfs_merge_group(&dev->kobj, &pm_runtime_attr_group); if (rc) goto err_out; } if (device_can_wakeup(dev)) { rc = sysfs_merge_group(&dev->kobj, &pm_wakeup_attr_group); if (rc) goto err_runtime; } if (dev->power.set_latency_tolerance) { rc = sysfs_merge_group(&dev->kobj, &pm_qos_latency_tolerance_attr_group); if (rc) goto err_wakeup; } return 0; err_wakeup: sysfs_unmerge_group(&dev->kobj, &pm_wakeup_attr_group); err_runtime: sysfs_unmerge_group(&dev->kobj, &pm_runtime_attr_group); err_out: sysfs_remove_group(&dev->kobj, &pm_attr_group); return rc; }
int dpm_sysfs_add(struct device *dev) { int rc; rc = sysfs_create_group(&dev->kobj, &pm_attr_group); if (rc) return rc; if (pm_runtime_callbacks_present(dev)) { rc = sysfs_merge_group(&dev->kobj, &pm_runtime_attr_group); if (rc) goto err_out; } if (device_can_wakeup(dev)) { rc = sysfs_merge_group(&dev->kobj, &pm_wakeup_attr_group); if (rc) { if (pm_runtime_callbacks_present(dev)) sysfs_unmerge_group(&dev->kobj, &pm_runtime_attr_group); goto err_out; } } return 0; err_out: sysfs_remove_group(&dev->kobj, &pm_attr_group); return rc; }
static int add_power_attributes(struct device *dev) { int rc = 0; if (is_usb_device(dev)) { struct usb_device *udev = to_usb_device(dev); rc = sysfs_merge_group(&dev->kobj, &power_attr_group); if (udev->usb2_hw_lpm_capable == 1) rc = sysfs_merge_group(&dev->kobj, &usb2_hardware_lpm_attr_group); } return rc; }
static int add_power_attributes(struct device *dev) { int rc = 0; if (is_usb_device(dev)) rc = sysfs_merge_group(&dev->kobj, &power_attr_group); return rc; }
static int intel_epb_online(unsigned int cpu) { struct device *cpu_dev = get_cpu_device(cpu); intel_epb_restore(); if (!cpuhp_tasks_frozen) sysfs_merge_group(&cpu_dev->kobj, &intel_epb_attr_group); return 0; }
static int add_power_attributes(struct device *dev) { int rc = 0; if (is_usb_device(dev)) { struct usb_device *udev = to_usb_device(dev); rc = sysfs_merge_group(&dev->kobj, &power_attr_group); if (udev->usb2_hw_lpm_capable == 1) rc = sysfs_merge_group(&dev->kobj, &usb2_hardware_lpm_attr_group); if ((udev->speed == USB_SPEED_SUPER || udev->speed == USB_SPEED_SUPER_PLUS) && udev->lpm_capable == 1) rc = sysfs_merge_group(&dev->kobj, &usb3_hardware_lpm_attr_group); } return rc; }
int dpm_sysfs_add(struct device *dev) { int rc; rc = sysfs_create_group(&dev->kobj, &pm_attr_group); if (rc == 0 && !dev->power.no_callbacks) { rc = sysfs_merge_group(&dev->kobj, &pm_runtime_attr_group); if (rc) sysfs_remove_group(&dev->kobj, &pm_attr_group); } return rc; }
void i915_setup_sysfs(struct drm_device *dev) { int ret; /* ILK doesn't have any residency information */ if (INTEL_INFO(dev)->gen < 6) return; ret = sysfs_merge_group(&dev->primary->kdev.kobj, &rc6_attr_group); if (ret) DRM_ERROR("sysfs setup failed\n"); }
int pm_qos_sysfs_add_flags(struct device *dev) { return sysfs_merge_group(&dev->kobj, &pm_qos_flags_attr_group); }
int pm_qos_sysfs_add_resume_latency(struct device *dev) { return sysfs_merge_group(&dev->kobj, &pm_qos_resume_latency_attr_group); }
int wakeup_sysfs_add(struct device *dev) { return sysfs_merge_group(&dev->kobj, &pm_wakeup_attr_group); }
int pm_qos_sysfs_add_latency_tolerance(struct device *dev) { return sysfs_merge_group(&dev->kobj, &pm_qos_latency_tolerance_attr_group); }