Commit 70fbdfef authored by Linus Torvalds's avatar Linus Torvalds

sysfs: remove redundant __compat_only_sysfs_link_entry_to_kobj fn

Commit 9255782f ("sysfs: Wrap __compat_only_sysfs_link_entry_to_kobj
function to change the symlink name") made this function a wrapper
around a new non-underscored function, which is a bit odd.  The normal
naming convention is the other way around: the underscored function is
the wrappee, and the non-underscored function is the wrapper.

There's only one single user (well, two call-sites in that user) of the
more limited double underscore version of this function, so just remove
the oddly named wrapper entirely and just add the extra NULL argument to
the user.

I considered just doing that in the merge, but that tends to make
history really hard to read.

Link: https://lore.kernel.org/lkml/CAHk-=wgkkmNV5tMzQDmPAQuNJBuMcry--Jb+h8H1o4RA3kF7QQ@mail.gmail.com/
Cc: Sourabh Jain <sourabhjain@linux.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent d38c07af
...@@ -514,15 +514,15 @@ static int tpm_add_legacy_sysfs(struct tpm_chip *chip) ...@@ -514,15 +514,15 @@ static int tpm_add_legacy_sysfs(struct tpm_chip *chip)
if (chip->flags & (TPM_CHIP_FLAG_TPM2 | TPM_CHIP_FLAG_VIRTUAL)) if (chip->flags & (TPM_CHIP_FLAG_TPM2 | TPM_CHIP_FLAG_VIRTUAL))
return 0; return 0;
rc = __compat_only_sysfs_link_entry_to_kobj( rc = compat_only_sysfs_link_entry_to_kobj(
&chip->dev.parent->kobj, &chip->dev.kobj, "ppi"); &chip->dev.parent->kobj, &chip->dev.kobj, "ppi", NULL);
if (rc && rc != -ENOENT) if (rc && rc != -ENOENT)
return rc; return rc;
/* All the names from tpm-sysfs */ /* All the names from tpm-sysfs */
for (i = chip->groups[0]->attrs; *i != NULL; ++i) { for (i = chip->groups[0]->attrs; *i != NULL; ++i) {
rc = __compat_only_sysfs_link_entry_to_kobj( rc = compat_only_sysfs_link_entry_to_kobj(
&chip->dev.parent->kobj, &chip->dev.kobj, (*i)->name); &chip->dev.parent->kobj, &chip->dev.kobj, (*i)->name, NULL);
if (rc) { if (rc) {
tpm_del_legacy_sysfs(chip); tpm_del_legacy_sysfs(chip);
return rc; return rc;
......
...@@ -415,22 +415,6 @@ void sysfs_remove_link_from_group(struct kobject *kobj, const char *group_name, ...@@ -415,22 +415,6 @@ void sysfs_remove_link_from_group(struct kobject *kobj, const char *group_name,
} }
EXPORT_SYMBOL_GPL(sysfs_remove_link_from_group); EXPORT_SYMBOL_GPL(sysfs_remove_link_from_group);
/**
* __compat_only_sysfs_link_entry_to_kobj - add a symlink to a kobject pointing
* to a group or an attribute
* @kobj: The kobject containing the group.
* @target_kobj: The target kobject.
* @target_name: The name of the target group or attribute.
*/
int __compat_only_sysfs_link_entry_to_kobj(struct kobject *kobj,
struct kobject *target_kobj,
const char *target_name)
{
return compat_only_sysfs_link_entry_to_kobj(kobj, target_kobj,
target_name, NULL);
}
EXPORT_SYMBOL_GPL(__compat_only_sysfs_link_entry_to_kobj);
/** /**
* compat_only_sysfs_link_entry_to_kobj - add a symlink to a kobject pointing * compat_only_sysfs_link_entry_to_kobj - add a symlink to a kobject pointing
* to a group or an attribute * to a group or an attribute
......
...@@ -297,9 +297,6 @@ int sysfs_add_link_to_group(struct kobject *kobj, const char *group_name, ...@@ -297,9 +297,6 @@ int sysfs_add_link_to_group(struct kobject *kobj, const char *group_name,
struct kobject *target, const char *link_name); struct kobject *target, const char *link_name);
void sysfs_remove_link_from_group(struct kobject *kobj, const char *group_name, void sysfs_remove_link_from_group(struct kobject *kobj, const char *group_name,
const char *link_name); const char *link_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, int compat_only_sysfs_link_entry_to_kobj(struct kobject *kobj,
struct kobject *target_kobj, struct kobject *target_kobj,
const char *target_name, const char *target_name,
...@@ -516,14 +513,6 @@ static inline void sysfs_remove_link_from_group(struct kobject *kobj, ...@@ -516,14 +513,6 @@ static inline void sysfs_remove_link_from_group(struct kobject *kobj,
{ {
} }
static inline int __compat_only_sysfs_link_entry_to_kobj(
struct kobject *kobj,
struct kobject *target_kobj,
const char *target_name)
{
return 0;
}
static inline int compat_only_sysfs_link_entry_to_kobj(struct kobject *kobj, static inline int compat_only_sysfs_link_entry_to_kobj(struct kobject *kobj,
struct kobject *target_kobj, struct kobject *target_kobj,
const char *target_name, const char *target_name,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment