Commit 990e53f8 authored by Tejun Heo's avatar Tejun Heo Committed by Greg Kroah-Hartman

sysfs: make sysfs_addrm_finish() return void

With the previous sysfs_add_one() update, there is only one user of
the return value of sysfs_addrm_finish() and the user can switch to
testing @sd easily.  Make sysfs_addrm_finish() return void for cleaner
semantics as suggested by Satyam Sharma.

This patch doesn't introduce any noticeable behavior change.
Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
Cc: Satyam Sharma <satyam.sharma@gmail.com>
Acked-by: default avatarCornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 23dc2799
...@@ -609,11 +609,8 @@ static void sysfs_drop_dentry(struct sysfs_dirent *sd) ...@@ -609,11 +609,8 @@ static void sysfs_drop_dentry(struct sysfs_dirent *sd)
* *
* LOCKING: * LOCKING:
* All mutexes acquired by sysfs_addrm_start() are released. * All mutexes acquired by sysfs_addrm_start() are released.
*
* RETURNS:
* Number of added/removed sysfs_dirents since sysfs_addrm_start().
*/ */
int sysfs_addrm_finish(struct sysfs_addrm_cxt *acxt) void sysfs_addrm_finish(struct sysfs_addrm_cxt *acxt)
{ {
/* release resources acquired by sysfs_addrm_start() */ /* release resources acquired by sysfs_addrm_start() */
mutex_unlock(&sysfs_mutex); mutex_unlock(&sysfs_mutex);
...@@ -639,8 +636,6 @@ int sysfs_addrm_finish(struct sysfs_addrm_cxt *acxt) ...@@ -639,8 +636,6 @@ int sysfs_addrm_finish(struct sysfs_addrm_cxt *acxt)
sysfs_deactivate(sd); sysfs_deactivate(sd);
sysfs_put(sd); sysfs_put(sd);
} }
return acxt->cnt;
} }
/** /**
......
...@@ -200,7 +200,10 @@ int sysfs_hash_and_remove(struct sysfs_dirent *dir_sd, const char *name) ...@@ -200,7 +200,10 @@ int sysfs_hash_and_remove(struct sysfs_dirent *dir_sd, const char *name)
if (sd) if (sd)
sysfs_remove_one(&acxt, sd); sysfs_remove_one(&acxt, sd);
if (sysfs_addrm_finish(&acxt)) sysfs_addrm_finish(&acxt);
if (sd)
return 0; return 0;
return -ENOENT; else
return -ENOENT;
} }
...@@ -66,7 +66,7 @@ extern int sysfs_add_one(struct sysfs_addrm_cxt *acxt, ...@@ -66,7 +66,7 @@ extern int sysfs_add_one(struct sysfs_addrm_cxt *acxt,
struct sysfs_dirent *sd); struct sysfs_dirent *sd);
extern void sysfs_remove_one(struct sysfs_addrm_cxt *acxt, extern void sysfs_remove_one(struct sysfs_addrm_cxt *acxt,
struct sysfs_dirent *sd); struct sysfs_dirent *sd);
extern int sysfs_addrm_finish(struct sysfs_addrm_cxt *acxt); extern void sysfs_addrm_finish(struct sysfs_addrm_cxt *acxt);
extern struct inode * sysfs_get_inode(struct sysfs_dirent *sd); extern struct inode * sysfs_get_inode(struct sysfs_dirent *sd);
extern void sysfs_instantiate(struct dentry *dentry, struct inode *inode); extern void sysfs_instantiate(struct dentry *dentry, struct inode *inode);
......
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