Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4f393828d1dae28905447fcc9845ba0b5f414c62
Commit:     4f393828d1dae28905447fcc9845ba0b5f414c62
Parent:     8df0c87cc33646a19a59c0f93c4f9a330d5ca5eb
Author:     Tejun Heo <[EMAIL PROTECTED]>
AuthorDate: Sat Apr 28 20:04:48 2007 -0300
Committer:  Mauro Carvalho Chehab <[EMAIL PROTECTED]>
CommitDate: Wed May 9 10:12:32 2007 -0300

    V4L/DVB (5573): Pvrusb2: kill unnecessary attribute->owner
    
    sysfs is now completely out of driver/module lifetime game.
    
    After deletion, a sysfs node doesn't access anything outside sysfs
    proper, so there's no reason to hold onto the attribute owners.
    
    Note that often the wrong modules were accounted for as owners leading
    to accessing removed modules.
    
    This patch kills now unnecessary attribute->owner.
    
    Note that with this change, userland holding a sysfs node does not
    prevent the backing module from being unloaded.
    
    For more info regarding lifetime rule cleanup, please read the following
    message:
        http://article.gmane.org/gmane.linux.kernel/510293
    
    Signed-off-by: Tejun Heo <[EMAIL PROTECTED]>
    Signed-off-by: Mike Isely <[EMAIL PROTECTED]>
    Signed-off-by: Mauro Carvalho Chehab <[EMAIL PROTECTED]>
---
 drivers/media/video/pvrusb2/pvrusb2-sysfs.c |   14 --------------
 1 files changed, 0 insertions(+), 14 deletions(-)

diff --git a/drivers/media/video/pvrusb2/pvrusb2-sysfs.c 
b/drivers/media/video/pvrusb2/pvrusb2-sysfs.c
index a741c55..7ab79ba 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-sysfs.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-sysfs.c
@@ -518,40 +518,32 @@ static void pvr2_sysfs_add_control(struct pvr2_sysfs 
*sfp,int ctl_id)
        }
        sfp->item_last = cip;
 
-       cip->attr_name.attr.owner = THIS_MODULE;
        cip->attr_name.attr.name = "name";
        cip->attr_name.attr.mode = S_IRUGO;
        cip->attr_name.show = fp->show_name;
 
-       cip->attr_type.attr.owner = THIS_MODULE;
        cip->attr_type.attr.name = "type";
        cip->attr_type.attr.mode = S_IRUGO;
        cip->attr_type.show = fp->show_type;
 
-       cip->attr_min.attr.owner = THIS_MODULE;
        cip->attr_min.attr.name = "min_val";
        cip->attr_min.attr.mode = S_IRUGO;
        cip->attr_min.show = fp->show_min;
 
-       cip->attr_max.attr.owner = THIS_MODULE;
        cip->attr_max.attr.name = "max_val";
        cip->attr_max.attr.mode = S_IRUGO;
        cip->attr_max.show = fp->show_max;
 
-       cip->attr_val.attr.owner = THIS_MODULE;
        cip->attr_val.attr.name = "cur_val";
        cip->attr_val.attr.mode = S_IRUGO;
 
-       cip->attr_custom.attr.owner = THIS_MODULE;
        cip->attr_custom.attr.name = "custom_val";
        cip->attr_custom.attr.mode = S_IRUGO;
 
-       cip->attr_enum.attr.owner = THIS_MODULE;
        cip->attr_enum.attr.name = "enum_val";
        cip->attr_enum.attr.mode = S_IRUGO;
        cip->attr_enum.show = fp->show_enum;
 
-       cip->attr_bits.attr.owner = THIS_MODULE;
        cip->attr_bits.attr.name = "bit_val";
        cip->attr_bits.attr.mode = S_IRUGO;
        cip->attr_bits.show = fp->show_bits;
@@ -616,12 +608,10 @@ static void pvr2_sysfs_add_debugifc(struct pvr2_sysfs 
*sfp)
 
        dip = kzalloc(sizeof(*dip),GFP_KERNEL);
        if (!dip) return;
-       dip->attr_debugcmd.attr.owner = THIS_MODULE;
        dip->attr_debugcmd.attr.name = "debugcmd";
        dip->attr_debugcmd.attr.mode = S_IRUGO|S_IWUSR|S_IWGRP;
        dip->attr_debugcmd.show = debugcmd_show;
        dip->attr_debugcmd.store = debugcmd_store;
-       dip->attr_debuginfo.attr.owner = THIS_MODULE;
        dip->attr_debuginfo.attr.name = "debuginfo";
        dip->attr_debuginfo.attr.mode = S_IRUGO;
        dip->attr_debuginfo.show = debuginfo_show;
@@ -811,7 +801,6 @@ static void class_dev_create(struct pvr2_sysfs *sfp,
                return;
        }
 
-       sfp->attr_v4l_minor_number.attr.owner = THIS_MODULE;
        sfp->attr_v4l_minor_number.attr.name = "v4l_minor_number";
        sfp->attr_v4l_minor_number.attr.mode = S_IRUGO;
        sfp->attr_v4l_minor_number.show = v4l_minor_number_show;
@@ -825,7 +814,6 @@ static void class_dev_create(struct pvr2_sysfs *sfp,
                sfp->v4l_minor_number_created_ok = !0;
        }
 
-       sfp->attr_v4l_radio_minor_number.attr.owner = THIS_MODULE;
        sfp->attr_v4l_radio_minor_number.attr.name = "v4l_radio_minor_number";
        sfp->attr_v4l_radio_minor_number.attr.mode = S_IRUGO;
        sfp->attr_v4l_radio_minor_number.show = v4l_radio_minor_number_show;
@@ -839,7 +827,6 @@ static void class_dev_create(struct pvr2_sysfs *sfp,
                sfp->v4l_radio_minor_number_created_ok = !0;
        }
 
-       sfp->attr_unit_number.attr.owner = THIS_MODULE;
        sfp->attr_unit_number.attr.name = "unit_number";
        sfp->attr_unit_number.attr.mode = S_IRUGO;
        sfp->attr_unit_number.show = unit_number_show;
@@ -852,7 +839,6 @@ static void class_dev_create(struct pvr2_sysfs *sfp,
                sfp->unit_number_created_ok = !0;
        }
 
-       sfp->attr_bus_info.attr.owner = THIS_MODULE;
        sfp->attr_bus_info.attr.name = "bus_info_str";
        sfp->attr_bus_info.attr.mode = S_IRUGO;
        sfp->attr_bus_info.show = bus_info_show;
-
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