aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2007-04-28 19:04:48 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-05-09 09:12:32 -0400
commit4f393828d1dae28905447fcc9845ba0b5f414c62 (patch)
treebf34bcf044d91c1e4f05078df3fe79e3f86c0ec0 /drivers/media/video
parent8df0c87cc33646a19a59c0f93c4f9a330d5ca5eb (diff)
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 <htejun@gmail.com> Signed-off-by: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video')
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-sysfs.c14
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 a741c556a39a..7ab79baa1c8c 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)
518 } 518 }
519 sfp->item_last = cip; 519 sfp->item_last = cip;
520 520
521 cip->attr_name.attr.owner = THIS_MODULE;
522 cip->attr_name.attr.name = "name"; 521 cip->attr_name.attr.name = "name";
523 cip->attr_name.attr.mode = S_IRUGO; 522 cip->attr_name.attr.mode = S_IRUGO;
524 cip->attr_name.show = fp->show_name; 523 cip->attr_name.show = fp->show_name;
525 524
526 cip->attr_type.attr.owner = THIS_MODULE;
527 cip->attr_type.attr.name = "type"; 525 cip->attr_type.attr.name = "type";
528 cip->attr_type.attr.mode = S_IRUGO; 526 cip->attr_type.attr.mode = S_IRUGO;
529 cip->attr_type.show = fp->show_type; 527 cip->attr_type.show = fp->show_type;
530 528
531 cip->attr_min.attr.owner = THIS_MODULE;
532 cip->attr_min.attr.name = "min_val"; 529 cip->attr_min.attr.name = "min_val";
533 cip->attr_min.attr.mode = S_IRUGO; 530 cip->attr_min.attr.mode = S_IRUGO;
534 cip->attr_min.show = fp->show_min; 531 cip->attr_min.show = fp->show_min;
535 532
536 cip->attr_max.attr.owner = THIS_MODULE;
537 cip->attr_max.attr.name = "max_val"; 533 cip->attr_max.attr.name = "max_val";
538 cip->attr_max.attr.mode = S_IRUGO; 534 cip->attr_max.attr.mode = S_IRUGO;
539 cip->attr_max.show = fp->show_max; 535 cip->attr_max.show = fp->show_max;
540 536
541 cip->attr_val.attr.owner = THIS_MODULE;
542 cip->attr_val.attr.name = "cur_val"; 537 cip->attr_val.attr.name = "cur_val";
543 cip->attr_val.attr.mode = S_IRUGO; 538 cip->attr_val.attr.mode = S_IRUGO;
544 539
545 cip->attr_custom.attr.owner = THIS_MODULE;
546 cip->attr_custom.attr.name = "custom_val"; 540 cip->attr_custom.attr.name = "custom_val";
547 cip->attr_custom.attr.mode = S_IRUGO; 541 cip->attr_custom.attr.mode = S_IRUGO;
548 542
549 cip->attr_enum.attr.owner = THIS_MODULE;
550 cip->attr_enum.attr.name = "enum_val"; 543 cip->attr_enum.attr.name = "enum_val";
551 cip->attr_enum.attr.mode = S_IRUGO; 544 cip->attr_enum.attr.mode = S_IRUGO;
552 cip->attr_enum.show = fp->show_enum; 545 cip->attr_enum.show = fp->show_enum;
553 546
554 cip->attr_bits.attr.owner = THIS_MODULE;
555 cip->attr_bits.attr.name = "bit_val"; 547 cip->attr_bits.attr.name = "bit_val";
556 cip->attr_bits.attr.mode = S_IRUGO; 548 cip->attr_bits.attr.mode = S_IRUGO;
557 cip->attr_bits.show = fp->show_bits; 549 cip->attr_bits.show = fp->show_bits;
@@ -616,12 +608,10 @@ static void pvr2_sysfs_add_debugifc(struct pvr2_sysfs *sfp)
616 608
617 dip = kzalloc(sizeof(*dip),GFP_KERNEL); 609 dip = kzalloc(sizeof(*dip),GFP_KERNEL);
618 if (!dip) return; 610 if (!dip) return;
619 dip->attr_debugcmd.attr.owner = THIS_MODULE;
620 dip->attr_debugcmd.attr.name = "debugcmd"; 611 dip->attr_debugcmd.attr.name = "debugcmd";
621 dip->attr_debugcmd.attr.mode = S_IRUGO|S_IWUSR|S_IWGRP; 612 dip->attr_debugcmd.attr.mode = S_IRUGO|S_IWUSR|S_IWGRP;
622 dip->attr_debugcmd.show = debugcmd_show; 613 dip->attr_debugcmd.show = debugcmd_show;
623 dip->attr_debugcmd.store = debugcmd_store; 614 dip->attr_debugcmd.store = debugcmd_store;
624 dip->attr_debuginfo.attr.owner = THIS_MODULE;
625 dip->attr_debuginfo.attr.name = "debuginfo"; 615 dip->attr_debuginfo.attr.name = "debuginfo";
626 dip->attr_debuginfo.attr.mode = S_IRUGO; 616 dip->attr_debuginfo.attr.mode = S_IRUGO;
627 dip->attr_debuginfo.show = debuginfo_show; 617 dip->attr_debuginfo.show = debuginfo_show;
@@ -811,7 +801,6 @@ static void class_dev_create(struct pvr2_sysfs *sfp,
811 return; 801 return;
812 } 802 }
813 803
814 sfp->attr_v4l_minor_number.attr.owner = THIS_MODULE;
815 sfp->attr_v4l_minor_number.attr.name = "v4l_minor_number"; 804 sfp->attr_v4l_minor_number.attr.name = "v4l_minor_number";
816 sfp->attr_v4l_minor_number.attr.mode = S_IRUGO; 805 sfp->attr_v4l_minor_number.attr.mode = S_IRUGO;
817 sfp->attr_v4l_minor_number.show = v4l_minor_number_show; 806 sfp->attr_v4l_minor_number.show = v4l_minor_number_show;
@@ -825,7 +814,6 @@ static void class_dev_create(struct pvr2_sysfs *sfp,
825 sfp->v4l_minor_number_created_ok = !0; 814 sfp->v4l_minor_number_created_ok = !0;
826 } 815 }
827 816
828 sfp->attr_v4l_radio_minor_number.attr.owner = THIS_MODULE;
829 sfp->attr_v4l_radio_minor_number.attr.name = "v4l_radio_minor_number"; 817 sfp->attr_v4l_radio_minor_number.attr.name = "v4l_radio_minor_number";
830 sfp->attr_v4l_radio_minor_number.attr.mode = S_IRUGO; 818 sfp->attr_v4l_radio_minor_number.attr.mode = S_IRUGO;
831 sfp->attr_v4l_radio_minor_number.show = v4l_radio_minor_number_show; 819 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,
839 sfp->v4l_radio_minor_number_created_ok = !0; 827 sfp->v4l_radio_minor_number_created_ok = !0;
840 } 828 }
841 829
842 sfp->attr_unit_number.attr.owner = THIS_MODULE;
843 sfp->attr_unit_number.attr.name = "unit_number"; 830 sfp->attr_unit_number.attr.name = "unit_number";
844 sfp->attr_unit_number.attr.mode = S_IRUGO; 831 sfp->attr_unit_number.attr.mode = S_IRUGO;
845 sfp->attr_unit_number.show = unit_number_show; 832 sfp->attr_unit_number.show = unit_number_show;
@@ -852,7 +839,6 @@ static void class_dev_create(struct pvr2_sysfs *sfp,
852 sfp->unit_number_created_ok = !0; 839 sfp->unit_number_created_ok = !0;
853 } 840 }
854 841
855 sfp->attr_bus_info.attr.owner = THIS_MODULE;
856 sfp->attr_bus_info.attr.name = "bus_info_str"; 842 sfp->attr_bus_info.attr.name = "bus_info_str";
857 sfp->attr_bus_info.attr.mode = S_IRUGO; 843 sfp->attr_bus_info.attr.mode = S_IRUGO;
858 sfp->attr_bus_info.show = bus_info_show; 844 sfp->attr_bus_info.show = bus_info_show;