Skip to content

Commit 70fbdfe

Browse files
committed
sysfs: remove redundant __compat_only_sysfs_link_entry_to_kobj fn
Commit 9255782 ("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 <[email protected]> Cc: Michael Ellerman <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent d38c07a commit 70fbdfe

File tree

3 files changed

+4
-31
lines changed

3 files changed

+4
-31
lines changed

drivers/char/tpm/tpm-chip.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -514,15 +514,15 @@ static int tpm_add_legacy_sysfs(struct tpm_chip *chip)
514514
if (chip->flags & (TPM_CHIP_FLAG_TPM2 | TPM_CHIP_FLAG_VIRTUAL))
515515
return 0;
516516

517-
rc = __compat_only_sysfs_link_entry_to_kobj(
518-
&chip->dev.parent->kobj, &chip->dev.kobj, "ppi");
517+
rc = compat_only_sysfs_link_entry_to_kobj(
518+
&chip->dev.parent->kobj, &chip->dev.kobj, "ppi", NULL);
519519
if (rc && rc != -ENOENT)
520520
return rc;
521521

522522
/* All the names from tpm-sysfs */
523523
for (i = chip->groups[0]->attrs; *i != NULL; ++i) {
524-
rc = __compat_only_sysfs_link_entry_to_kobj(
525-
&chip->dev.parent->kobj, &chip->dev.kobj, (*i)->name);
524+
rc = compat_only_sysfs_link_entry_to_kobj(
525+
&chip->dev.parent->kobj, &chip->dev.kobj, (*i)->name, NULL);
526526
if (rc) {
527527
tpm_del_legacy_sysfs(chip);
528528
return rc;

fs/sysfs/group.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -415,22 +415,6 @@ void sysfs_remove_link_from_group(struct kobject *kobj, const char *group_name,
415415
}
416416
EXPORT_SYMBOL_GPL(sysfs_remove_link_from_group);
417417

418-
/**
419-
* __compat_only_sysfs_link_entry_to_kobj - add a symlink to a kobject pointing
420-
* to a group or an attribute
421-
* @kobj: The kobject containing the group.
422-
* @target_kobj: The target kobject.
423-
* @target_name: The name of the target group or attribute.
424-
*/
425-
int __compat_only_sysfs_link_entry_to_kobj(struct kobject *kobj,
426-
struct kobject *target_kobj,
427-
const char *target_name)
428-
{
429-
return compat_only_sysfs_link_entry_to_kobj(kobj, target_kobj,
430-
target_name, NULL);
431-
}
432-
EXPORT_SYMBOL_GPL(__compat_only_sysfs_link_entry_to_kobj);
433-
434418
/**
435419
* compat_only_sysfs_link_entry_to_kobj - add a symlink to a kobject pointing
436420
* to a group or an attribute

include/linux/sysfs.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -297,9 +297,6 @@ int sysfs_add_link_to_group(struct kobject *kobj, const char *group_name,
297297
struct kobject *target, const char *link_name);
298298
void sysfs_remove_link_from_group(struct kobject *kobj, const char *group_name,
299299
const char *link_name);
300-
int __compat_only_sysfs_link_entry_to_kobj(struct kobject *kobj,
301-
struct kobject *target_kobj,
302-
const char *target_name);
303300
int compat_only_sysfs_link_entry_to_kobj(struct kobject *kobj,
304301
struct kobject *target_kobj,
305302
const char *target_name,
@@ -516,14 +513,6 @@ static inline void sysfs_remove_link_from_group(struct kobject *kobj,
516513
{
517514
}
518515

519-
static inline int __compat_only_sysfs_link_entry_to_kobj(
520-
struct kobject *kobj,
521-
struct kobject *target_kobj,
522-
const char *target_name)
523-
{
524-
return 0;
525-
}
526-
527516
static inline int compat_only_sysfs_link_entry_to_kobj(struct kobject *kobj,
528517
struct kobject *target_kobj,
529518
const char *target_name,

0 commit comments

Comments
 (0)