linux/arch/powerpc
Lukas Wunner 3cc50d07be driver core: Add device_show_string() helper for sysfs attributes
For drivers wishing to expose an unsigned long, int or bool at a static
memory location in sysfs, the driver core provides ready-made helpers
such as device_show_ulong() to be used as ->show() callback.

Some drivers need to expose a string and so far they all provide their
own ->show() implementation.  arch/powerpc/perf/hv-24x7.c went so far
as to create a device_show_string() helper but kept it private.

Make it public for reuse by other drivers.  The pattern seems to be
sufficiently frequent to merit a public helper.

Add a DEVICE_STRING_ATTR_RO() macro in line with the existing
DEVICE_ULONG_ATTR() and similar macros to ease declaration of string
attributes.

Signed-off-by: Lukas Wunner <lukas@wunner.de>
Acked-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/2e3eaaf2600bb55c0415c23ba301e809403a7aa2.1713608122.git.lukas@wunner.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-05-04 17:37:03 +02:00
..
boot USB/Thunderbolt changes for 6.9-rc1 2024-03-21 12:35:20 -07:00
configs powerpc: Add allmodconfig for all 32-bit sub-arches 2024-03-03 22:20:29 +11:00
crypto powerpc/crypto/chacha-p10: Fix failure on non Power10 2024-04-05 00:02:18 +11:00
include vdso: Use CONFIG_PAGE_SHIFT in vdso/datapage.h 2024-04-03 21:50:04 +02:00
kernel powerpc/iommu: Refactor spapr_tce_platform_iommu_attach_dev() 2024-04-03 14:28:55 +11:00
kexec powerpc/kdump: Split KEXEC_CORE and CRASH_DUMP dependency 2024-03-17 13:34:00 +11:00
kvm powerpc updates for 6.9 2024-03-15 17:53:48 -07:00
lib powerpc: xor_vmx: Add '-mhard-float' to CFLAGS 2024-03-07 00:13:28 +11:00
math-emu powerpc/math-emu: Inhibit W=1 warnings 2022-09-08 11:11:18 +10:00
mm powerpc: Handle error in mark_rodata_ro() and mark_initmem_nx() 2024-03-17 13:33:21 +11:00
net powerpc/bpf: use bpf_jit_binary_pack_[alloc|finalize|free] 2023-10-23 20:33:19 +11:00
perf driver core: Add device_show_string() helper for sysfs attributes 2024-05-04 17:37:03 +02:00
platforms treewide: Use sysfs_bin_attr_simple_read() helper 2024-04-11 16:02:25 +02:00
purgatory powerpc/purgatory: remove PGO flags 2023-06-12 11:31:50 -07:00
sysdev powerpc updates for 6.9 2024-03-15 17:53:48 -07:00
tools powerpc/tools: Pass -mabi=elfv2 to gcc-check-mprofile-kernel.sh 2023-10-20 17:46:33 +11:00
xmon powerpc updates for 6.9 2024-03-15 17:53:48 -07:00
Kbuild
Kconfig powerpc/kdump: Split KEXEC_CORE and CRASH_DUMP dependency 2024-03-17 13:34:00 +11:00
Kconfig.debug powerpc/ps3: move udbg_shutdown_ps3gelic prototype 2023-11-21 12:06:50 +11:00
Makefile powerpc updates for 6.9 2024-03-15 17:53:48 -07:00
Makefile.postlink kbuild: remove ARCH_POSTLINK from module builds 2023-10-28 21:10:08 +09:00