aboutsummaryrefslogtreecommitdiffstats
path: root/fs/sysfs
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2007-08-02 08:38:03 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-10-12 17:51:04 -0400
commit990e53f880be9ff93072b4cce590ec2826cee0b6 (patch)
treefaa7cbedef2f1d9b8d27832ccbaa28e508d134e8 /fs/sysfs
parent23dc279950a056c33a14d09cf759f5173d41abd9 (diff)
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: Tejun Heo <htejun@gmail.com> Cc: Satyam Sharma <satyam.sharma@gmail.com> Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'fs/sysfs')
-rw-r--r--fs/sysfs/dir.c7
-rw-r--r--fs/sysfs/inode.c7
-rw-r--r--fs/sysfs/sysfs.h2
3 files changed, 7 insertions, 9 deletions
diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c
index 620603296c6..a0da2b05a75 100644
--- a/fs/sysfs/dir.c
+++ b/fs/sysfs/dir.c
@@ -609,11 +609,8 @@ static void sysfs_drop_dentry(struct sysfs_dirent *sd)
609 * 609 *
610 * LOCKING: 610 * LOCKING:
611 * All mutexes acquired by sysfs_addrm_start() are released. 611 * All mutexes acquired by sysfs_addrm_start() are released.
612 *
613 * RETURNS:
614 * Number of added/removed sysfs_dirents since sysfs_addrm_start().
615 */ 612 */
616int sysfs_addrm_finish(struct sysfs_addrm_cxt *acxt) 613void sysfs_addrm_finish(struct sysfs_addrm_cxt *acxt)
617{ 614{
618 /* release resources acquired by sysfs_addrm_start() */ 615 /* release resources acquired by sysfs_addrm_start() */
619 mutex_unlock(&sysfs_mutex); 616 mutex_unlock(&sysfs_mutex);
@@ -639,8 +636,6 @@ int sysfs_addrm_finish(struct sysfs_addrm_cxt *acxt)
639 sysfs_deactivate(sd); 636 sysfs_deactivate(sd);
640 sysfs_put(sd); 637 sysfs_put(sd);
641 } 638 }
642
643 return acxt->cnt;
644} 639}
645 640
646/** 641/**
diff --git a/fs/sysfs/inode.c b/fs/sysfs/inode.c
index efb4062fe09..e22db6cd4df 100644
--- a/fs/sysfs/inode.c
+++ b/fs/sysfs/inode.c
@@ -200,7 +200,10 @@ int sysfs_hash_and_remove(struct sysfs_dirent *dir_sd, const char *name)
200 if (sd) 200 if (sd)
201 sysfs_remove_one(&acxt, sd); 201 sysfs_remove_one(&acxt, sd);
202 202
203 if (sysfs_addrm_finish(&acxt)) 203 sysfs_addrm_finish(&acxt);
204
205 if (sd)
204 return 0; 206 return 0;
205 return -ENOENT; 207 else
208 return -ENOENT;
206} 209}
diff --git a/fs/sysfs/sysfs.h b/fs/sysfs/sysfs.h
index bb3f0c999b1..04367547103 100644
--- a/fs/sysfs/sysfs.h
+++ b/fs/sysfs/sysfs.h
@@ -66,7 +66,7 @@ extern int sysfs_add_one(struct sysfs_addrm_cxt *acxt,
66 struct sysfs_dirent *sd); 66 struct sysfs_dirent *sd);
67extern void sysfs_remove_one(struct sysfs_addrm_cxt *acxt, 67extern void sysfs_remove_one(struct sysfs_addrm_cxt *acxt,
68 struct sysfs_dirent *sd); 68 struct sysfs_dirent *sd);
69extern int sysfs_addrm_finish(struct sysfs_addrm_cxt *acxt); 69extern void sysfs_addrm_finish(struct sysfs_addrm_cxt *acxt);
70 70
71extern struct inode * sysfs_get_inode(struct sysfs_dirent *sd); 71extern struct inode * sysfs_get_inode(struct sysfs_dirent *sd);
72extern void sysfs_instantiate(struct dentry *dentry, struct inode *inode); 72extern void sysfs_instantiate(struct dentry *dentry, struct inode *inode);