Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=11f24fbdf511cf588c3a18e3208ee02d85db0020
Commit:     11f24fbdf511cf588c3a18e3208ee02d85db0020
Parent:     d0ad3bc97c06fba5d37b4ca03c03b7eeeda39c47
Author:     James Bottomley <[EMAIL PROTECTED]>
AuthorDate: Wed Jan 2 18:44:05 2008 -0600
Committer:  James Bottomley <[EMAIL PROTECTED]>
CommitDate: Wed Jan 23 11:29:17 2008 -0600

    [SCSI] sysfs: fix the sysfs_add_file_to_group interfaces
    
    I can't see a reason why these shouldn't work on every group.  However,
    they only seem to work on named groups.  This patch allows the group
    functions to work on anonymous groups (those with NULL names).
    
    Acked-by: Tejun Heo <[EMAIL PROTECTED]>
    Acked-by: Kay Sievers <[EMAIL PROTECTED]>
    Acked-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
    Signed-off-by: James Bottomley <[EMAIL PROTECTED]>
---
 fs/sysfs/file.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c
index 4045bdc..b834f17 100644
--- a/fs/sysfs/file.c
+++ b/fs/sysfs/file.c
@@ -568,7 +568,11 @@ int sysfs_add_file_to_group(struct kobject *kobj,
        struct sysfs_dirent *dir_sd;
        int error;
 
-       dir_sd = sysfs_get_dirent(kobj->sd, group);
+       if (group)
+               dir_sd = sysfs_get_dirent(kobj->sd, group);
+       else
+               dir_sd = sysfs_get(kobj->sd);
+
        if (!dir_sd)
                return -ENOENT;
 
@@ -656,7 +660,10 @@ void sysfs_remove_file_from_group(struct kobject *kobj,
 {
        struct sysfs_dirent *dir_sd;
 
-       dir_sd = sysfs_get_dirent(kobj->sd, group);
+       if (group)
+               dir_sd = sysfs_get_dirent(kobj->sd, group);
+       else
+               dir_sd = sysfs_get(kobj->sd);
        if (dir_sd) {
                sysfs_hash_and_remove(dir_sd, attr->name);
                sysfs_put(dir_sd);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to