diff options
| author | 2024-04-20 22:00:04 +0200 | |
|---|---|---|
| committer | 2024-05-04 17:37:03 +0200 | |
| commit | b91b73a43822566930490e5aa421ccb1900a2124 (patch) | |
| tree | 63663bca2c8789cac302c3a19475bd8594d0557f /drivers/perf/arm-ccn.c | |
| parent | IB/qib: Use device_show_string() helper for sysfs attributes (diff) | |
| download | wireguard-linux-b91b73a43822566930490e5aa421ccb1900a2124.tar.xz wireguard-linux-b91b73a43822566930490e5aa421ccb1900a2124.zip | |
perf: Use device_show_string() helper for sysfs attributes
Deduplicate sysfs ->show() callbacks which expose a string at a static
memory location. Use the newly introduced device_show_string() helper
in the driver core instead by declaring those sysfs attributes with
DEVICE_STRING_ATTR_RO().
No functional change intended.
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Link: https://lore.kernel.org/r/3a297850312b4ecb62d6872121de04496900f502.1713608122.git.lukas@wunner.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/perf/arm-ccn.c')
| -rw-r--r-- | drivers/perf/arm-ccn.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/drivers/perf/arm-ccn.c b/drivers/perf/arm-ccn.c index 641471bd5eff..e4408acd4450 100644 --- a/drivers/perf/arm-ccn.c +++ b/drivers/perf/arm-ccn.c @@ -215,18 +215,9 @@ static void arm_ccn_pmu_config_set(u64 *config, u32 node_xp, u32 type, u32 port) *config |= (node_xp << 0) | (type << 8) | (port << 24); } -static ssize_t arm_ccn_pmu_format_show(struct device *dev, - struct device_attribute *attr, char *buf) -{ - struct dev_ext_attribute *ea = container_of(attr, - struct dev_ext_attribute, attr); - - return sysfs_emit(buf, "%s\n", (char *)ea->var); -} - #define CCN_FORMAT_ATTR(_name, _config) \ struct dev_ext_attribute arm_ccn_pmu_format_attr_##_name = \ - { __ATTR(_name, S_IRUGO, arm_ccn_pmu_format_show, \ + { __ATTR(_name, S_IRUGO, device_show_string, \ NULL), _config } static CCN_FORMAT_ATTR(node, "config:0-7"); |
