diff options
author | Sourabh Jain <sourabhjain@linux.ibm.com> | 2019-12-11 21:39:06 +0530 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2020-02-19 21:07:09 +1100 |
commit | 9255782f70614c89b1a15ec6997c4b72ce9e630a (patch) | |
tree | e170801c0010faf3b1fed320fedcf7c52d01b25f /include | |
parent | f52153ab383f04a45c38d8a7f55a4249477b20df (diff) | |
download | linux-stable-9255782f70614c89b1a15ec6997c4b72ce9e630a.tar.gz linux-stable-9255782f70614c89b1a15ec6997c4b72ce9e630a.tar.bz2 linux-stable-9255782f70614c89b1a15ec6997c4b72ce9e630a.zip |
sysfs: Wrap __compat_only_sysfs_link_entry_to_kobj function to change the symlink name
The __compat_only_sysfs_link_entry_to_kobj function creates a symlink
to a kobject but doesn't provide an option to change the symlink file
name.
This patch adds a wrapper function compat_only_sysfs_link_entry_to_kobj
that extends the __compat_only_sysfs_link_entry_to_kobj functionality
which allows function caller to customize the symlink name.
Signed-off-by: Sourabh Jain <sourabhjain@linux.ibm.com>
[mpe: Fix compile error when CONFIG_SYSFS=n]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20191211160910.21656-3-sourabhjain@linux.ibm.com
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/sysfs.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h index fa7ee503fb76..7462315a643b 100644 --- a/include/linux/sysfs.h +++ b/include/linux/sysfs.h @@ -300,6 +300,10 @@ void sysfs_remove_link_from_group(struct kobject *kobj, const char *group_name, int __compat_only_sysfs_link_entry_to_kobj(struct kobject *kobj, struct kobject *target_kobj, const char *target_name); +int compat_only_sysfs_link_entry_to_kobj(struct kobject *kobj, + struct kobject *target_kobj, + const char *target_name, + const char *symlink_name); void sysfs_notify(struct kobject *kobj, const char *dir, const char *attr); @@ -508,6 +512,14 @@ static inline int __compat_only_sysfs_link_entry_to_kobj( return 0; } +static inline int compat_only_sysfs_link_entry_to_kobj(struct kobject *kobj, + struct kobject *target_kobj, + const char *target_name, + const char *symlink_name) +{ + return 0; +} + static inline void sysfs_notify(struct kobject *kobj, const char *dir, const char *attr) { |