Commit 6dbbc783 authored by Srinivas Pandruvada's avatar Srinivas Pandruvada Committed by yingbao jia
Browse files

platform/x86/intel/uncore-freq: Use sysfs API to create attributes

mainline inclusion
from mainline-v5.18-rc1
commit ae7b2ce5
category: feature
bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I78KDD
CVE: NA
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ae7b2ce578513adf0a77f0127e27ee4447d50443



Intel-SIG: commit ae7b2ce5 platform/x86/intel/uncore-freq: Use sysfs API to create attributes.
Backport for intel-uncore-freqe driver

-------------------------------------------------

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: default avatarSrinivas Pandruvada <srinivas.pandruvada@intel.com>
Acked-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://lore.kernel.org/r/20220204000306.2517447-3-srinivas.pandruvada@linux.intel.com


Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avataryingbao jia <yingbao.jia@intel.com>
parent 5e730aa5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment