Skip to content

Commit 44a45be

Browse files
l1kgregkh
authored andcommitted
sysfs: Unbreak the build around sysfs_bin_attr_simple_read()
Günter reports build breakage for m68k "m5208evb_defconfig" plus CONFIG_BLK_DEV_INITRD=y caused by commit 66bc1a1 ("treewide: Use sysfs_bin_attr_simple_read() helper"). The defconfig disables CONFIG_SYSFS, so sysfs_bin_attr_simple_read() is not compiled into the kernel. But init/initramfs.c references that function in the initializer of a struct bin_attribute. Add an empty static inline to avoid the build breakage. Fixes: 66bc1a1 ("treewide: Use sysfs_bin_attr_simple_read() helper") Reported-by: Guenter Roeck <[email protected]> Closes: https://lore.kernel.org/r/[email protected] Signed-off-by: Lukas Wunner <[email protected]> Tested-by: Guenter Roeck <[email protected]> Reviewed-by: Rafael J. Wysocki <[email protected]> Link: https://lore.kernel.org/r/05f4290439a58730738a15b0c99cd8576c4aa0d9.1716461752.git.lukas@wunner.de Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 9711873 commit 44a45be

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

include/linux/sysfs.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,15 @@ static inline int sysfs_emit_at(char *buf, int at, const char *fmt, ...)
750750
{
751751
return 0;
752752
}
753+
754+
static inline ssize_t sysfs_bin_attr_simple_read(struct file *file,
755+
struct kobject *kobj,
756+
struct bin_attribute *attr,
757+
char *buf, loff_t off,
758+
size_t count)
759+
{
760+
return 0;
761+
}
753762
#endif /* CONFIG_SYSFS */
754763

755764
static inline int __must_check sysfs_create_file(struct kobject *kobj,

0 commit comments

Comments
 (0)