diff options
| author | Dmitry Torokhov <[email protected]> | 2023-08-30 16:06:38 -0700 | 
|---|---|---|
| committer | Dmitry Torokhov <[email protected]> | 2023-08-30 16:06:38 -0700 | 
| commit | 1ac731c529cd4d6adbce134754b51ff7d822b145 (patch) | |
| tree | 143ab3f35ca5f3b69f583c84e6964b17139c2ec1 /drivers/acpi/acpi_lpit.c | |
| parent | 07b4c950f27bef0362dc6ad7ee713aab61d58149 (diff) | |
| parent | 54116d442e001e1b6bd482122043b1870998a1f3 (diff) | |
Merge branch 'next' into for-linus
Prepare input updates for 6.6 merge window.
Diffstat (limited to 'drivers/acpi/acpi_lpit.c')
| -rw-r--r-- | drivers/acpi/acpi_lpit.c | 16 | 
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/acpi/acpi_lpit.c b/drivers/acpi/acpi_lpit.c index 3843d2576d3f..c5598b6d5db8 100644 --- a/drivers/acpi/acpi_lpit.c +++ b/drivers/acpi/acpi_lpit.c @@ -98,6 +98,12 @@ EXPORT_SYMBOL_GPL(lpit_read_residency_count_address);  static void lpit_update_residency(struct lpit_residency_info *info,  				 struct acpi_lpit_native *lpit_native)  { +	struct device *dev_root = bus_get_dev_root(&cpu_subsys); + +	/* Silently fail, if cpuidle attribute group is not present */ +	if (!dev_root) +		return; +  	info->frequency = lpit_native->counter_frequency ?  				lpit_native->counter_frequency : tsc_khz * 1000;  	if (!info->frequency) @@ -108,18 +114,18 @@ static void lpit_update_residency(struct lpit_residency_info *info,  		info->iomem_addr = ioremap(info->gaddr.address,  						   info->gaddr.bit_width / 8);  		if (!info->iomem_addr) -			return; +			goto exit; -		/* Silently fail, if cpuidle attribute group is not present */ -		sysfs_add_file_to_group(&cpu_subsys.dev_root->kobj, +		sysfs_add_file_to_group(&dev_root->kobj,  					&dev_attr_low_power_idle_system_residency_us.attr,  					"cpuidle");  	} else if (info->gaddr.space_id == ACPI_ADR_SPACE_FIXED_HARDWARE) { -		/* Silently fail, if cpuidle attribute group is not present */ -		sysfs_add_file_to_group(&cpu_subsys.dev_root->kobj, +		sysfs_add_file_to_group(&dev_root->kobj,  					&dev_attr_low_power_idle_cpu_residency_us.attr,  					"cpuidle");  	} +exit: +	put_device(dev_root);  }  static void lpit_process(u64 begin, u64 end)  |