]> git.baikalelectronics.ru Git - kernel.git/commit
platform/x86/intel/uncore-freq: Use sysfs API to create attributes
authorSrinivas Pandruvada <srinivas.pandruvada@intel.com>
Fri, 4 Feb 2022 00:03:04 +0000 (16:03 -0800)
committerHans de Goede <hdegoede@redhat.com>
Thu, 17 Feb 2022 12:20:30 +0000 (13:20 +0100)
commit25c2e09ea2c04eb3829603f6d0dbc6ef49bd8f4d
tree91c6adec71b86be9d0bdf5eb97c3556488141727
parent7a6c697d60c8e475ed708275e16fd8ce128fedf9
platform/x86/intel/uncore-freq: Use sysfs API to create attributes

Use of sysfs API is always preferable over using kobject calls to create
attributes. Remove usage of kobject_init_and_add() and use
sysfs_create_group(). To create relationship between sysfs attribute
and uncore instance use device_attribute*, which is defined per
uncore instance.

To create uniform locking for both read and write attributes take
lock in the sysfs callbacks, not in the actual functions where
the MSRs are read or updated.

No functional changes are expected.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@intel.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://lore.kernel.org/r/20220204000306.2517447-3-srinivas.pandruvada@linux.intel.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
drivers/platform/x86/intel/uncore-frequency/uncore-frequency.c