sysfs: kill unnecessary attribute->owner
authorTejun Heo <htejun@gmail.com>
Wed, 13 Jun 2007 18:45:17 +0000 (03:45 +0900)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 11 Jul 2007 23:09:06 +0000 (16:09 -0700)
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

(tweaked by Greg to not delete the field just yet, to make it easier to
merge things properly.)

Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
55 files changed:
arch/ppc/syslib/mv64x60.c
arch/s390/kernel/ipl.c
drivers/base/bus.c
drivers/base/class.c
drivers/base/core.c
drivers/base/firmware_class.c
drivers/block/pktcdvd.c
drivers/char/ipmi/ipmi_msghandler.c
drivers/cpufreq/cpufreq_stats.c
drivers/cpufreq/cpufreq_userspace.c
drivers/cpufreq/freq_table.c
drivers/firmware/dcdbas.h
drivers/firmware/dell_rbu.c
drivers/firmware/edd.c
drivers/firmware/efivars.c
drivers/i2c/chips/eeprom.c
drivers/i2c/chips/max6875.c
drivers/infiniband/core/sysfs.c
drivers/input/mouse/psmouse.h
drivers/macintosh/windfarm_core.c
drivers/misc/asus-laptop.c
drivers/net/ibmveth.c
drivers/parisc/pdc_stable.c
drivers/pci/hotplug/acpiphp_ibm.c
drivers/pci/pci-sysfs.c
drivers/pci/probe.c
drivers/pcmcia/socket_sysfs.c
drivers/rapidio/rio-sysfs.c
drivers/rtc/rtc-ds1553.c
drivers/rtc/rtc-ds1742.c
drivers/s390/cio/chp.c
drivers/s390/net/qeth_sys.c
drivers/scsi/arcmsr/arcmsr_attr.c
drivers/scsi/libsas/sas_expander.c
drivers/scsi/lpfc/lpfc_attr.c
drivers/scsi/qla2xxx/qla_attr.c
drivers/spi/at25.c
drivers/video/aty/radeon_base.c
drivers/video/backlight/backlight.c
drivers/video/backlight/lcd.c
drivers/w1/slaves/w1_ds2433.c
drivers/w1/slaves/w1_therm.c
drivers/w1/w1.c
drivers/zorro/zorro-sysfs.c
fs/ecryptfs/main.c
fs/ocfs2/cluster/masklog.c
fs/partitions/check.c
fs/sysfs/bin.c
fs/sysfs/file.c
include/linux/sysdev.h
include/linux/sysfs.h
kernel/module.c
kernel/params.c
net/bridge/br_sysfs_br.c
net/bridge/br_sysfs_if.c

index 8485a68cd4753ade53df7dcce6771b44d02d9387..032f4b7f42257c7566fee56e084bd88ed6f5bc23 100644 (file)
@@ -2415,7 +2415,6 @@ static struct bin_attribute mv64xxx_hs_reg_attr = { /* Hotswap register */
        .attr = {
                .name = "hs_reg",
                .mode = S_IRUGO | S_IWUSR,
-               .owner = THIS_MODULE,
        },
        .size  = VAL_LEN_MAX,
        .read  = mv64xxx_hs_reg_read,
index 82b131ddd7ffa17b06bdfb149d53db4bc8951421..9a13b24ee1ab2e751715ce014823d22a60828b54 100644 (file)
@@ -312,7 +312,6 @@ static struct bin_attribute ipl_parameter_attr = {
        .attr = {
                .name = "binary_parameter",
                .mode = S_IRUGO,
-               .owner = THIS_MODULE,
        },
        .size = PAGE_SIZE,
        .read = &ipl_parameter_read,
@@ -336,7 +335,6 @@ static struct bin_attribute ipl_scp_data_attr = {
        .attr = {
                .name = "scp_data",
                .mode = S_IRUGO,
-               .owner = THIS_MODULE,
        },
        .size = PAGE_SIZE,
        .read = &ipl_scp_data_read,
index f299e0d6abc4ca299c8acbe3e7a4b69deb32875a..61c67526a656c29d05a1a1e93bba6f4e86872a14 100644 (file)
@@ -574,7 +574,6 @@ static int add_probe_files(struct bus_type *bus)
 
        bus->drivers_probe_attr.attr.name = "drivers_probe";
        bus->drivers_probe_attr.attr.mode = S_IWUSR;
-       bus->drivers_probe_attr.attr.owner = bus->owner;
        bus->drivers_probe_attr.store = store_drivers_probe;
        retval = bus_create_file(bus, &bus->drivers_probe_attr);
        if (retval)
@@ -582,7 +581,6 @@ static int add_probe_files(struct bus_type *bus)
 
        bus->drivers_autoprobe_attr.attr.name = "drivers_autoprobe";
        bus->drivers_autoprobe_attr.attr.mode = S_IWUSR | S_IRUGO;
-       bus->drivers_autoprobe_attr.attr.owner = bus->owner;
        bus->drivers_autoprobe_attr.show = show_drivers_autoprobe;
        bus->drivers_autoprobe_attr.store = store_drivers_autoprobe;
        retval = bus_create_file(bus, &bus->drivers_autoprobe_attr);
index 8c506dbe39138bc11b8901944a81461c5a424e79..9cbfde23b9e3974a6ddb4ccc84ad9601258f667f 100644 (file)
@@ -605,7 +605,6 @@ int class_device_add(struct class_device *class_dev)
                goto out3;
        class_dev->uevent_attr.attr.name = "uevent";
        class_dev->uevent_attr.attr.mode = S_IWUSR;
-       class_dev->uevent_attr.attr.owner = parent_class->owner;
        class_dev->uevent_attr.store = store_uevent;
        error = class_device_create_file(class_dev, &class_dev->uevent_attr);
        if (error)
@@ -620,7 +619,6 @@ int class_device_add(struct class_device *class_dev)
                }
                attr->attr.name = "dev";
                attr->attr.mode = S_IRUGO;
-               attr->attr.owner = parent_class->owner;
                attr->show = show_dev;
                error = class_device_create_file(class_dev, attr);
                if (error) {
index cff4fbfbb055285a365dfa2f840a264facfc3747..e3fb87bfc6e107f2f156c4fcb7a8650b8f51a01c 100644 (file)
@@ -683,8 +683,6 @@ int device_add(struct device *dev)
 
        dev->uevent_attr.attr.name = "uevent";
        dev->uevent_attr.attr.mode = S_IRUGO | S_IWUSR;
-       if (dev->driver)
-               dev->uevent_attr.attr.owner = dev->driver->owner;
        dev->uevent_attr.store = store_uevent;
        dev->uevent_attr.show = show_uevent;
        error = device_create_file(dev, &dev->uevent_attr);
@@ -700,8 +698,6 @@ int device_add(struct device *dev)
                }
                attr->attr.name = "dev";
                attr->attr.mode = S_IRUGO;
-               if (dev->driver)
-                       attr->attr.owner = dev->driver->owner;
                attr->show = show_dev;
                error = device_create_file(dev, attr);
                if (error) {
index 89a5f4a5491391e2270069090f43c6e82b6ef601..0e511485d2e6224ada48d9e5f5cb89dcc7338715 100644 (file)
@@ -271,7 +271,7 @@ out:
 }
 
 static struct bin_attribute firmware_attr_data_tmpl = {
-       .attr = {.name = "data", .mode = 0644, .owner = THIS_MODULE},
+       .attr = {.name = "data", .mode = 0644},
        .size = 0,
        .read = firmware_data_read,
        .write = firmware_data_write,
index f1b9dd7d47d62c00868acdba0927d68a0c8777e0..ce64e86d6ffbb9d4205a96f0e189dec7519632ca 100644 (file)
@@ -146,8 +146,7 @@ static void pkt_kobj_release(struct kobject *kobj)
  **********************************************************/
 
 #define DEF_ATTR(_obj,_name,_mode) \
-       static struct attribute _obj = { \
-               .name = _name, .owner = THIS_MODULE, .mode = _mode }
+       static struct attribute _obj = { .name = _name, .mode = _mode }
 
 /**********************************************************
   /sys/class/pktcdvd/pktcdvd[0-7]/
index 8e222f2b80cc4bb2ee28535e936fcd83d6fb397c..b5df7e61aeb2aa4b7282733d357a24dee06b887a 100644 (file)
@@ -2171,52 +2171,42 @@ static int create_files(struct bmc_device *bmc)
        int err;
 
        bmc->device_id_attr.attr.name = "device_id";
-       bmc->device_id_attr.attr.owner = THIS_MODULE;
        bmc->device_id_attr.attr.mode = S_IRUGO;
        bmc->device_id_attr.show = device_id_show;
 
        bmc->provides_dev_sdrs_attr.attr.name = "provides_device_sdrs";
-       bmc->provides_dev_sdrs_attr.attr.owner = THIS_MODULE;
        bmc->provides_dev_sdrs_attr.attr.mode = S_IRUGO;
        bmc->provides_dev_sdrs_attr.show = provides_dev_sdrs_show;
 
        bmc->revision_attr.attr.name = "revision";
-       bmc->revision_attr.attr.owner = THIS_MODULE;
        bmc->revision_attr.attr.mode = S_IRUGO;
        bmc->revision_attr.show = revision_show;
 
        bmc->firmware_rev_attr.attr.name = "firmware_revision";
-       bmc->firmware_rev_attr.attr.owner = THIS_MODULE;
        bmc->firmware_rev_attr.attr.mode = S_IRUGO;
        bmc->firmware_rev_attr.show = firmware_rev_show;
 
        bmc->version_attr.attr.name = "ipmi_version";
-       bmc->version_attr.attr.owner = THIS_MODULE;
        bmc->version_attr.attr.mode = S_IRUGO;
        bmc->version_attr.show = ipmi_version_show;
 
        bmc->add_dev_support_attr.attr.name = "additional_device_support";
-       bmc->add_dev_support_attr.attr.owner = THIS_MODULE;
        bmc->add_dev_support_attr.attr.mode = S_IRUGO;
        bmc->add_dev_support_attr.show = add_dev_support_show;
 
        bmc->manufacturer_id_attr.attr.name = "manufacturer_id";
-       bmc->manufacturer_id_attr.attr.owner = THIS_MODULE;
        bmc->manufacturer_id_attr.attr.mode = S_IRUGO;
        bmc->manufacturer_id_attr.show = manufacturer_id_show;
 
        bmc->product_id_attr.attr.name = "product_id";
-       bmc->product_id_attr.attr.owner = THIS_MODULE;
        bmc->product_id_attr.attr.mode = S_IRUGO;
        bmc->product_id_attr.show = product_id_show;
 
        bmc->guid_attr.attr.name = "guid";
-       bmc->guid_attr.attr.owner = THIS_MODULE;
        bmc->guid_attr.attr.mode = S_IRUGO;
        bmc->guid_attr.show = guid_show;
 
        bmc->aux_firmware_rev_attr.attr.name = "aux_firmware_revision";
-       bmc->aux_firmware_rev_attr.attr.owner = THIS_MODULE;
        bmc->aux_firmware_rev_attr.attr.mode = S_IRUGO;
        bmc->aux_firmware_rev_attr.show = aux_firmware_rev_show;
 
index d2f0cbd8b8f3f294ef7a1f834d52bbfcb2bf02c3..917b9bab9ccbc924a6e583997cf96dc03e09071f 100644 (file)
@@ -25,8 +25,7 @@ static spinlock_t cpufreq_stats_lock;
 
 #define CPUFREQ_STATDEVICE_ATTR(_name,_mode,_show) \
 static struct freq_attr _attr_##_name = {\
-       .attr = {.name = __stringify(_name), .owner = THIS_MODULE, \
-               .mode = _mode, }, \
+       .attr = {.name = __stringify(_name), .mode = _mode, }, \
        .show = _show,\
 };
 
index 860345c7799ab1188c21945756ec6e696019b10e..a648970338b09a1a641799fc3d52e10b2d14b604 100644 (file)
@@ -120,7 +120,7 @@ store_speed (struct cpufreq_policy *policy, const char *buf, size_t count)
 
 static struct freq_attr freq_attr_scaling_setspeed =
 {
-       .attr = { .name = "scaling_setspeed", .mode = 0644, .owner = THIS_MODULE },
+       .attr = { .name = "scaling_setspeed", .mode = 0644 },
        .show = show_speed,
        .store = store_speed,
 };
index e7490925fdcf51acaf7d00039a609465a1aaf54d..5409f3afb3f85fab2a0b7e160c2972805b0a374d 100644 (file)
@@ -199,7 +199,6 @@ static ssize_t show_available_freqs (struct cpufreq_policy *policy, char *buf)
 struct freq_attr cpufreq_freq_attr_scaling_available_freqs = {
        .attr = { .name = "scaling_available_frequencies",
                  .mode = 0444,
-                 .owner=THIS_MODULE
                },
        .show = show_available_freqs,
 };
index 58a85182b3e8d589d704000a25cfc5ecfab23351..dcdba0f1b32c835cdcd37d0d2cb975442ab31348 100644 (file)
@@ -67,8 +67,7 @@
 #define DCDBAS_BIN_ATTR_RW(_name) \
 struct bin_attribute bin_attr_##_name = { \
        .attr =  { .name = __stringify(_name), \
-                  .mode = 0600, \
-                  .owner = THIS_MODULE }, \
+                  .mode = 0600 }, \
        .read =  _name##_read, \
        .write = _name##_write, \
 }
index fc702e40bd431c2cfdd715beacd636fb3d886c49..f8afecb7d0cfcba62c94290a68c30b28c976eb4e 100644 (file)
@@ -687,18 +687,18 @@ static ssize_t write_rbu_packet_size(struct kobject *kobj, char *buffer,
 }
 
 static struct bin_attribute rbu_data_attr = {
-       .attr = {.name = "data",.owner = THIS_MODULE,.mode = 0444},
+       .attr = {.name = "data", .mode = 0444},
        .read = read_rbu_data,
 };
 
 static struct bin_attribute rbu_image_type_attr = {
-       .attr = {.name = "image_type",.owner = THIS_MODULE,.mode = 0644},
+       .attr = {.name = "image_type", .mode = 0644},
        .read = read_rbu_image_type,
        .write = write_rbu_image_type,
 };
 
 static struct bin_attribute rbu_packet_size_attr = {
-       .attr = {.name = "packet_size",.owner = THIS_MODULE,.mode = 0644},
+       .attr = {.name = "packet_size", .mode = 0644},
        .read = read_rbu_packet_size,
        .write = write_rbu_packet_size,
 };
index d8806e4f182984c841603d8d3d365c77d98c6cec..15232271d848c225364df28d17b10dc7d60217be 100644 (file)
@@ -74,7 +74,7 @@ static struct edd_device *edd_devices[EDD_MBR_SIG_MAX];
 
 #define EDD_DEVICE_ATTR(_name,_mode,_show,_test) \
 struct edd_attribute edd_attr_##_name = {      \
-       .attr = {.name = __stringify(_name), .mode = _mode, .owner = THIS_MODULE },     \
+       .attr = {.name = __stringify(_name), .mode = _mode },   \
        .show   = _show,                                \
        .test   = _test,                                \
 };
index 1324984a4c355e1accf093f05608c0d214579303..bfd2d67df689d8ccb33138c78935b73ae7363d31 100644 (file)
@@ -131,21 +131,21 @@ struct efivar_attribute {
 
 #define EFI_ATTR(_name, _mode, _show, _store) \
 struct subsys_attribute efi_attr_##_name = { \
-       .attr = {.name = __stringify(_name), .mode = _mode, .owner = THIS_MODULE}, \
+       .attr = {.name = __stringify(_name), .mode = _mode}, \
        .show = _show, \
        .store = _store, \
 };
 
 #define EFIVAR_ATTR(_name, _mode, _show, _store) \
 struct efivar_attribute efivar_attr_##_name = { \
-       .attr = {.name = __stringify(_name), .mode = _mode, .owner = THIS_MODULE}, \
+       .attr = {.name = __stringify(_name), .mode = _mode}, \
        .show = _show, \
        .store = _store, \
 };
 
 #define VAR_SUBSYS_ATTR(_name, _mode, _show, _store) \
 struct subsys_attribute var_subsys_attr_##_name = { \
-       .attr = {.name = __stringify(_name), .mode = _mode, .owner = THIS_MODULE}, \
+       .attr = {.name = __stringify(_name), .mode = _mode}, \
        .show = _show, \
        .store = _store, \
 };
index bfce13c8f1ff764d9c6036a8b4cef9cb86cdf106..5990dd5fc77363d21c64e2e15960c980351dde25 100644 (file)
@@ -143,7 +143,6 @@ static struct bin_attribute eeprom_attr = {
        .attr = {
                .name = "eeprom",
                .mode = S_IRUGO,
-               .owner = THIS_MODULE,
        },
        .size = EEPROM_SIZE,
        .read = eeprom_read,
index 76645c1429776e182b87e3d2578adc40222cffa1..1405ce5b236cfe8111b8708077f3b582d6ef26c8 100644 (file)
@@ -152,7 +152,6 @@ static struct bin_attribute user_eeprom_attr = {
        .attr = {
                .name = "eeprom",
                .mode = S_IRUGO,
-               .owner = THIS_MODULE,
        },
        .size = USER_EEPROM_SIZE,
        .read = max6875_read,
index 08c299ebf4a8b5da88872c9116782ce5dd91c3ec..bf9b99292048f283a4ecbbb5137f51c981adfc7d 100644 (file)
@@ -479,7 +479,6 @@ alloc_group_attrs(ssize_t (*show)(struct ib_port *,
 
                element->attr.attr.name  = element->name;
                element->attr.attr.mode  = S_IRUGO;
-               element->attr.attr.owner = THIS_MODULE;
                element->attr.show       = show;
                element->index           = i;
 
index 27a68835b5ba1559cd3a498a1730cd18de516d8e..1317bdd8cc7c42c935fac9899c5bdcbda0a5a51b 100644 (file)
@@ -119,7 +119,6 @@ static struct psmouse_attribute psmouse_attr_##_name = {                    \
                .attr   = {                                                     \
                        .name   = __stringify(_name),                           \
                        .mode   = _mode,                                        \
-                       .owner  = THIS_MODULE,                                  \
                },                                                              \
                .show   = psmouse_attr_show_helper,                             \
                .store  = psmouse_attr_set_helper,                              \
index 11ced17f438a8469a39cf303eda067ff9b21193b..4fcb245ba184edd3d06684f4e2572b5571918212 100644 (file)
@@ -212,7 +212,6 @@ int wf_register_control(struct wf_control *new_ct)
        list_add(&new_ct->link, &wf_controls);
 
        new_ct->attr.attr.name = new_ct->name;
-       new_ct->attr.attr.owner = THIS_MODULE;
        new_ct->attr.attr.mode = 0644;
        new_ct->attr.show = wf_show_control;
        new_ct->attr.store = wf_store_control;
@@ -325,7 +324,6 @@ int wf_register_sensor(struct wf_sensor *new_sr)
        list_add(&new_sr->link, &wf_sensors);
 
        new_sr->attr.attr.name = new_sr->name;
-       new_sr->attr.attr.owner = THIS_MODULE;
        new_sr->attr.attr.mode = 0444;
        new_sr->attr.show = wf_show_sensor;
        new_sr->attr.store = NULL;
index 4f9060a2a2f2fce960486d07132fa889179510aa..7798f590e5aab8c840b3f839d249926e67308343 100644 (file)
@@ -737,8 +737,7 @@ static void asus_hotk_notify(acpi_handle handle, u32 event, void *data)
        struct device_attribute dev_attr_##_name = {                    \
                .attr = {                                               \
                        .name = __stringify(_name),                     \
-                       .mode = 0,                                      \
-                       .owner = THIS_MODULE },                         \
+                       .mode = 0 },                                    \
                .show   = NULL,                                         \
                .store  = NULL,                                         \
        }
index 6ec3d500f3341ac491519c60d27d2f2c1b936c45..d96eb72295488fe486136df191a3a0f8c8b6b96d 100644 (file)
@@ -1337,7 +1337,7 @@ const char * buf, size_t count)
 
 #define ATTR(_name, _mode)      \
         struct attribute veth_##_name##_attr = {               \
-        .name = __stringify(_name), .mode = _mode, .owner = THIS_MODULE \
+        .name = __stringify(_name), .mode = _mode, \
         };
 
 static ATTR(active, 0644);
index 924ef0609460f4a338e0423101741ab92f96c8e1..fc4bde259dc7a68da93c89640aa36db34f5744e5 100644 (file)
@@ -121,14 +121,14 @@ struct pdcspath_entry pdcspath_entry_##_name = { \
 
 #define PDCS_ATTR(_name, _mode, _show, _store) \
 struct subsys_attribute pdcs_attr_##_name = { \
-       .attr = {.name = __stringify(_name), .mode = _mode, .owner = THIS_MODULE}, \
+       .attr = {.name = __stringify(_name), .mode = _mode}, \
        .show = _show, \
        .store = _store, \
 };
 
 #define PATHS_ATTR(_name, _mode, _show, _store) \
 struct pdcspath_attribute paths_attr_##_name = { \
-       .attr = {.name = __stringify(_name), .mode = _mode, .owner = THIS_MODULE}, \
+       .attr = {.name = __stringify(_name), .mode = _mode}, \
        .show = _show, \
        .store = _store, \
 };
index e7322c25d377e65949722fd1f71b04edabb957d2..74556ec31a5b3b2bb79559ea540d0a76f6e3fc21 100644 (file)
@@ -117,7 +117,6 @@ static struct notification ibm_note;
 static struct bin_attribute ibm_apci_table_attr = {
            .attr = {
                    .name = "apci_table",
-                   .owner = THIS_MODULE,
                    .mode = S_IRUGO,
            },
            .read = ibm_read_apci_table,
index 284e83a527f9d4564c916597f6d65b21b2cff08c..d448f8df8613086e401d2b674107a28056fd64a7 100644 (file)
@@ -499,7 +499,6 @@ static int pci_create_resource_files(struct pci_dev *pdev)
                        sprintf(res_attr_name, "resource%d", i);
                        res_attr->attr.name = res_attr_name;
                        res_attr->attr.mode = S_IRUSR | S_IWUSR;
-                       res_attr->attr.owner = THIS_MODULE;
                        res_attr->size = pci_resource_len(pdev, i);
                        res_attr->mmap = pci_mmap_resource;
                        res_attr->private = &pdev->resource[i];
@@ -582,7 +581,6 @@ static struct bin_attribute pci_config_attr = {
        .attr = {
                .name = "config",
                .mode = S_IRUGO | S_IWUSR,
-               .owner = THIS_MODULE,
        },
        .size = 256,
        .read = pci_read_config,
@@ -593,7 +591,6 @@ static struct bin_attribute pcie_config_attr = {
        .attr = {
                .name = "config",
                .mode = S_IRUGO | S_IWUSR,
-               .owner = THIS_MODULE,
        },
        .size = 4096,
        .read = pci_read_config,
@@ -628,7 +625,6 @@ int __must_check pci_create_sysfs_dev_files (struct pci_dev *pdev)
                        rom_attr->size = pci_resource_len(pdev, PCI_ROM_RESOURCE);
                        rom_attr->attr.name = "rom";
                        rom_attr->attr.mode = S_IRUSR;
-                       rom_attr->attr.owner = THIS_MODULE;
                        rom_attr->read = pci_read_rom;
                        rom_attr->write = pci_write_rom;
                        retval = sysfs_create_bin_file(&pdev->dev.kobj, rom_attr);
index e48fcf0896212193ace241d8f066fb8de9100feb..08783bd381f53fd0fa08f5444451bf03cd600159 100644 (file)
@@ -39,7 +39,6 @@ static void pci_create_legacy_files(struct pci_bus *b)
                b->legacy_io->attr.name = "legacy_io";
                b->legacy_io->size = 0xffff;
                b->legacy_io->attr.mode = S_IRUSR | S_IWUSR;
-               b->legacy_io->attr.owner = THIS_MODULE;
                b->legacy_io->read = pci_read_legacy_io;
                b->legacy_io->write = pci_write_legacy_io;
                class_device_create_bin_file(&b->class_dev, b->legacy_io);
@@ -49,7 +48,6 @@ static void pci_create_legacy_files(struct pci_bus *b)
                b->legacy_mem->attr.name = "legacy_mem";
                b->legacy_mem->size = 1024*1024;
                b->legacy_mem->attr.mode = S_IRUSR | S_IWUSR;
-               b->legacy_mem->attr.owner = THIS_MODULE;
                b->legacy_mem->mmap = pci_mmap_legacy_mem;
                class_device_create_bin_file(&b->class_dev, b->legacy_mem);
        }
index a2bb46526b56cdd8028a49e1394034d501a40807..dbfbe65779e5d91e867e4dece9c0e8cc368a8c90 100644 (file)
@@ -366,7 +366,7 @@ static struct device_attribute *pccard_socket_attributes[] = {
 };
 
 static struct bin_attribute pccard_cis_attr = {
-       .attr = { .name = "cis", .mode = S_IRUGO | S_IWUSR, .owner = THIS_MODULE},
+       .attr = { .name = "cis", .mode = S_IRUGO | S_IWUSR },
        .size = 0x200,
        .read = pccard_show_cis,
        .write = pccard_store_cis,
index eed91434417d7d39e86a2bca4602700e8dfe3177..a3972b9f96e631d645841d9682c8e6c4dc818305 100644 (file)
@@ -197,7 +197,6 @@ static struct bin_attribute rio_config_attr = {
        .attr = {
                 .name = "config",
                 .mode = S_IRUGO | S_IWUSR,
-                .owner = THIS_MODULE,
                 },
        .size = 0x200000,
        .read = rio_read_config,
index afa64c7fa2e2d67152b50fe75b011e7cf2c8a6f2..b024cfb558f4e526e661bf8cd70c5471b1cf019f 100644 (file)
@@ -290,7 +290,6 @@ static struct bin_attribute ds1553_nvram_attr = {
        .attr = {
                .name = "nvram",
                .mode = S_IRUGO | S_IWUGO,
-               .owner = THIS_MODULE,
        },
        .size = RTC_OFFSET,
        .read = ds1553_nvram_read,
index d68288b389dc18b041c07060dac49da774da5df1..1638acdbc9135cdff2dda49477723b3ec6f7ccc4 100644 (file)
@@ -159,7 +159,6 @@ static struct bin_attribute ds1742_nvram_attr = {
        .attr = {
                .name = "nvram",
                .mode = S_IRUGO | S_IWUGO,
-               .owner = THIS_MODULE,
        },
        .read = ds1742_nvram_read,
        .write = ds1742_nvram_write,
index ac289e6eadfe9ea1ef0a54c7d0de74b68c243108..96a8a72a6083923b112d42caf59476cf9a5710aa 100644 (file)
@@ -165,7 +165,6 @@ static struct bin_attribute chp_measurement_chars_attr = {
        .attr = {
                .name = "measurement_chars",
                .mode = S_IRUSR,
-               .owner = THIS_MODULE,
        },
        .size = sizeof(struct cmg_chars),
        .read = chp_measurement_chars_read,
@@ -217,7 +216,6 @@ static struct bin_attribute chp_measurement_attr = {
        .attr = {
                .name = "measurement",
                .mode = S_IRUSR,
-               .owner = THIS_MODULE,
        },
        .size = sizeof(struct cmg_entry),
        .read = chp_measurement_read,
index 65ffc21afc37525d53010daff7d0ccf86d9a3bb5..bb0287ad1aacff26f97cd80ecf6278ad946f003b 100644 (file)
@@ -991,7 +991,7 @@ static struct attribute_group qeth_osn_device_attr_group = {
 
 #define QETH_DEVICE_ATTR(_id,_name,_mode,_show,_store)                      \
 struct device_attribute dev_attr_##_id = {                                  \
-       .attr = {.name=__stringify(_name), .mode=_mode, .owner=THIS_MODULE },\
+       .attr = {.name=__stringify(_name), .mode=_mode, },\
        .show   = _show,                                                     \
        .store  = _store,                                                    \
 };
index 03bfed61bffcb0da68f8e94b51ccac757ef0673d..8908228bc134ec2670cc3a1a687ab5eb8277e567 100644 (file)
@@ -188,7 +188,6 @@ static struct bin_attribute arcmsr_sysfs_message_read_attr = {
        .attr = {
                .name = "mu_read",
                .mode = S_IRUSR ,
-               .owner = THIS_MODULE,
        },
        .size = 1032,
        .read = arcmsr_sysfs_iop_message_read,
@@ -198,7 +197,6 @@ static struct bin_attribute arcmsr_sysfs_message_write_attr = {
        .attr = {
                .name = "mu_write",
                .mode = S_IWUSR,
-               .owner = THIS_MODULE,
        },
        .size = 1032,
        .write = arcmsr_sysfs_iop_message_write,
@@ -208,7 +206,6 @@ static struct bin_attribute arcmsr_sysfs_message_clear_attr = {
        .attr = {
                .name = "mu_clear",
                .mode = S_IWUSR,
-               .owner = THIS_MODULE,
        },
        .size = 1,
        .write = arcmsr_sysfs_iop_message_clear,
index e34442e405e8a8aa96e05f0f195b20958a9a2ddb..578ed79f41485541db2ec904eada5e73e86b5bdc 100644 (file)
@@ -1368,7 +1368,6 @@ static void sas_ex_smp_hook(struct domain_device *dev)
        memset(bin_attr, 0, sizeof(*bin_attr));
 
        bin_attr->attr.name = SMP_BIN_ATTR_NAME;
-       bin_attr->attr.owner = THIS_MODULE;
        bin_attr->attr.mode = 0600;
 
        bin_attr->size = 0;
index 95fe77e816f80a756b937f6012b8ab989e14ac74..f81fe501a4a180eeb22a11de6c2b6c77db022dca 100644 (file)
@@ -1200,7 +1200,6 @@ static struct bin_attribute sysfs_ctlreg_attr = {
        .attr = {
                .name = "ctlreg",
                .mode = S_IRUSR | S_IWUSR,
-               .owner = THIS_MODULE,
        },
        .size = 256,
        .read = sysfs_ctlreg_read,
@@ -1422,7 +1421,6 @@ static struct bin_attribute sysfs_mbox_attr = {
        .attr = {
                .name = "mbox",
                .mode = S_IRUSR | S_IWUSR,
-               .owner = THIS_MODULE,
        },
        .size = MAILBOX_CMD_SIZE,
        .read = sysfs_mbox_read,
index 8081b637d97e06550253eb0ddb12bfba0ef27ba5..96587253bfa9bc1bb598129d3eb0947a42e2bc85 100644 (file)
@@ -73,7 +73,6 @@ static struct bin_attribute sysfs_fw_dump_attr = {
        .attr = {
                .name = "fw_dump",
                .mode = S_IRUSR | S_IWUSR,
-               .owner = THIS_MODULE,
        },
        .size = 0,
        .read = qla2x00_sysfs_read_fw_dump,
@@ -149,7 +148,6 @@ static struct bin_attribute sysfs_nvram_attr = {
        .attr = {
                .name = "nvram",
                .mode = S_IRUSR | S_IWUSR,
-               .owner = THIS_MODULE,
        },
        .size = 512,
        .read = qla2x00_sysfs_read_nvram,
@@ -198,7 +196,6 @@ static struct bin_attribute sysfs_optrom_attr = {
        .attr = {
                .name = "optrom",
                .mode = S_IRUSR | S_IWUSR,
-               .owner = THIS_MODULE,
        },
        .size = OPTROM_SIZE_24XX,
        .read = qla2x00_sysfs_read_optrom,
@@ -279,7 +276,6 @@ static struct bin_attribute sysfs_optrom_ctl_attr = {
        .attr = {
                .name = "optrom_ctl",
                .mode = S_IWUSR,
-               .owner = THIS_MODULE,
        },
        .size = 0,
        .write = qla2x00_sysfs_write_optrom_ctl,
@@ -327,7 +323,6 @@ static struct bin_attribute sysfs_vpd_attr = {
        .attr = {
                .name = "vpd",
                .mode = S_IRUSR | S_IWUSR,
-               .owner = THIS_MODULE,
        },
        .size = 0,
        .read = qla2x00_sysfs_read_vpd,
@@ -375,7 +370,6 @@ static struct bin_attribute sysfs_sfp_attr = {
        .attr = {
                .name = "sfp",
                .mode = S_IRUSR | S_IWUSR,
-               .owner = THIS_MODULE,
        },
        .size = SFP_DEV_SIZE * 2,
        .read = qla2x00_sysfs_read_sfp,
index 8efa07e8b8c2a7bef31ce118109b622e42de210d..fde1dededba3ec04b560ffe69dea558b6b4e05ad 100644 (file)
@@ -314,7 +314,6 @@ static int at25_probe(struct spi_device *spi)
         */
        at25->bin.attr.name = "eeprom";
        at25->bin.attr.mode = S_IRUSR;
-       at25->bin.attr.owner = THIS_MODULE;
        at25->bin.read = at25_bin_read;
 
        at25->bin.size = at25->chip.byte_len;
index 2ce05019301892d9a0420f97ef2b803f8742100a..3b3c6571f58377ebe9c619b20a3d6bb05b5a7c34 100644 (file)
@@ -2126,7 +2126,6 @@ static ssize_t radeon_show_edid2(struct kobject *kobj, char *buf, loff_t off, si
 static struct bin_attribute edid1_attr = {
        .attr   = {
                .name   = "edid1",
-               .owner  = THIS_MODULE,
                .mode   = 0444,
        },
        .size   = EDID_LENGTH,
@@ -2136,7 +2135,6 @@ static struct bin_attribute edid1_attr = {
 static struct bin_attribute edid2_attr = {
        .attr   = {
                .name   = "edid2",
-               .owner  = THIS_MODULE,
                .mode   = 0444,
        },
        .size   = EDID_LENGTH,
index c65e81ff3578fedb1ff1e00bde752f252f77a8e0..7e06223bca9494178632f444b989a554f3e5180f 100644 (file)
@@ -172,7 +172,7 @@ static struct class backlight_class = {
 
 #define DECLARE_ATTR(_name,_mode,_show,_store)                 \
 {                                                              \
-       .attr   = { .name = __stringify(_name), .mode = _mode, .owner = THIS_MODULE },  \
+       .attr   = { .name = __stringify(_name), .mode = _mode }, \
        .show   = _show,                                        \
        .store  = _store,                                       \
 }
index 6ef8f0a7a137612deb25cbb3377f49e31e8aa93e..648b53c1fdea7f7f2687f8f5d6b60c179f61007a 100644 (file)
@@ -157,7 +157,7 @@ static struct class lcd_class = {
 
 #define DECLARE_ATTR(_name,_mode,_show,_store)                 \
 {                                                              \
-       .attr   = { .name = __stringify(_name), .mode = _mode, .owner = THIS_MODULE },  \
+       .attr   = { .name = __stringify(_name), .mode = _mode }, \
        .show   = _show,                                        \
        .store  = _store,                                       \
 }
index 8ea17a53eed853223be23df1e78878009ebf5577..4e13aa71adea8271f917fb48e9fe2a67b7dbab87 100644 (file)
@@ -252,7 +252,6 @@ static struct bin_attribute w1_f23_bin_attr = {
        .attr = {
                .name = "eeprom",
                .mode = S_IRUGO | S_IWUSR,
-               .owner = THIS_MODULE,
        },
        .size = W1_EEPROM_SIZE,
        .read = w1_f23_read_bin,
index 1a6937dc190b777369eac30ace6ea0aa665963bc..8ba4e572e09c3a2768545799a7c58a5f28eb4b52 100644 (file)
@@ -48,7 +48,6 @@ static struct bin_attribute w1_therm_bin_attr = {
        .attr = {
                .name = "w1_slave",
                .mode = S_IRUGO,
-               .owner = THIS_MODULE,
        },
        .size = W1_SLAVE_DATA_SIZE,
        .read = w1_therm_read_bin,
index 7d6876dbcc96a6dcf5cb85f12eb3a10045e52123..1838cb29b646d7c82d02e32fef9ec92284e4ee2e 100644 (file)
@@ -128,7 +128,6 @@ static struct bin_attribute w1_slave_attr_bin_id = {
       .attr = {
               .name = "id",
               .mode = S_IRUGO,
-              .owner = THIS_MODULE,
       },
       .size = 8,
       .read = w1_slave_read_id,
@@ -167,7 +166,6 @@ static struct bin_attribute w1_default_attr = {
       .attr = {
               .name = "rw",
               .mode = S_IRUGO | S_IWUSR,
-              .owner = THIS_MODULE,
       },
       .size = PAGE_SIZE,
       .read = w1_default_read,
index c3ba0ec334c45a419513343d7abd505633364482..7e03cc68b18297916d28a01b44b3ac63eaeb6013 100644 (file)
@@ -78,7 +78,6 @@ static struct bin_attribute zorro_config_attr = {
        .attr = {
                .name = "config",
                .mode = S_IRUGO | S_IWUSR,
-               .owner = THIS_MODULE
        },
        .size = sizeof(struct ConfigDev),
        .read = zorro_read_config,
index 606128f5c927d3697c04f4f84ee64718e9cfd71b..02ca6f1e55d77d09ddd4d057c9e02bdc8c33ef5a 100644 (file)
@@ -840,8 +840,6 @@ static int __init ecryptfs_init(void)
                goto out;
        }
        kobj_set_kset_s(&ecryptfs_subsys, fs_subsys);
-       sysfs_attr_version.attr.owner = THIS_MODULE;
-       sysfs_attr_version_str.attr.owner = THIS_MODULE;
        rc = do_sysfs_registration();
        if (rc) {
                printk(KERN_ERR "sysfs registration failed\n");
index 2b205f5d5790e73d281f6fbf7e298d2f7dc3b782..e9e042b93dbf520ed9dc2c4b64a0e1b96590c0a1 100644 (file)
@@ -74,7 +74,6 @@ struct mlog_attribute {
 #define define_mask(_name) {                   \
        .attr = {                               \
                .name = #_name,                 \
-               .owner = THIS_MODULE,           \
                .mode = S_IRUGO | S_IWUSR,      \
        },                                      \
        .mask = ML_##_name,                     \
index 9a3a058f355365405911c3f1173209cfac30150d..98e0b85a9bb268cd6677af538dc153a61af2f7f6 100644 (file)
@@ -397,7 +397,6 @@ void add_partition(struct gendisk *disk, int part, sector_t start, sector_t len,
                static struct attribute addpartattr = {
                        .name = "whole_disk",
                        .mode = S_IRUSR | S_IRGRP | S_IROTH,
-                       .owner = THIS_MODULE,
                };
 
                sysfs_create_file(&p->kobj, &addpartattr);
index 618b8aea6a7ba869b15f6d35731440d945631641..3c5574a40b09f8d7a9340995ecffc0e1bc9448dd 100644 (file)
@@ -175,25 +175,20 @@ static int open(struct inode * inode, struct file * file)
        if (!sysfs_get_active(attr_sd))
                return -ENODEV;
 
-       /* Grab the module reference for this attribute */
-       error = -ENODEV;
-       if (!try_module_get(attr->attr.owner))
-               goto err_sput;
-
        error = -EACCES;
        if ((file->f_mode & FMODE_WRITE) && !(attr->write || attr->mmap))
-               goto err_mput;
+               goto err_out;
        if ((file->f_mode & FMODE_READ) && !(attr->read || attr->mmap))
-               goto err_mput;
+               goto err_out;
 
        error = -ENOMEM;
        bb = kzalloc(sizeof(*bb), GFP_KERNEL);
        if (!bb)
-               goto err_mput;
+               goto err_out;
 
        bb->buffer = kmalloc(PAGE_SIZE, GFP_KERNEL);
        if (!bb->buffer)
-               goto err_mput;
+               goto err_out;
 
        mutex_init(&bb->mutex);
        file->private_data = bb;
@@ -203,9 +198,7 @@ static int open(struct inode * inode, struct file * file)
        sysfs_get(attr_sd);
        return 0;
 
- err_mput:
-       module_put(attr->attr.owner);
- err_sput:
+ err_out:
        sysfs_put_active(attr_sd);
        kfree(bb);
        return error;
@@ -214,13 +207,11 @@ static int open(struct inode * inode, struct file * file)
 static int release(struct inode * inode, struct file * file)
 {
        struct sysfs_dirent *attr_sd = file->f_path.dentry->d_fsdata;
-       struct bin_attribute *attr = attr_sd->s_elem.bin_attr.bin_attr;
        struct bin_buffer *bb = file->private_data;
 
        if (bb->mmapped)
                sysfs_put_active_two(attr_sd);
        sysfs_put(attr_sd);
-       module_put(attr->attr.owner);
        kfree(bb->buffer);
        kfree(bb);
        return 0;
index d673d9b5d33f8ba17ec0bf7cb0ece118b90964d8..a84b734f7b2947c3784b41c34b4f344705a8bd98 100644 (file)
@@ -241,7 +241,6 @@ sysfs_write_file(struct file *file, const char __user *buf, size_t count, loff_t
 static int sysfs_open_file(struct inode *inode, struct file *file)
 {
        struct sysfs_dirent *attr_sd = file->f_path.dentry->d_fsdata;
-       struct attribute *attr = attr_sd->s_elem.attr.attr;
        struct kobject *kobj = attr_sd->s_parent->s_elem.dir.kobj;
        struct sysfs_buffer * buffer;
        struct sysfs_ops * ops = NULL;
@@ -251,11 +250,6 @@ static int sysfs_open_file(struct inode *inode, struct file *file)
        if (!sysfs_get_active_two(attr_sd))
                return -ENODEV;
 
-       /* Grab the module reference for this attribute */
-       error = -ENODEV;
-       if (!try_module_get(attr->owner))
-               goto err_sput;
-
        /* if the kobject has no ktype, then we assume that it is a subsystem
         * itself, and use ops for it.
         */
@@ -272,7 +266,7 @@ static int sysfs_open_file(struct inode *inode, struct file *file)
         * or the subsystem have no operations.
         */
        if (!ops)
-               goto err_mput;
+               goto err_out;
 
        /* File needs write support.
         * The inode's perms must say it's ok, 
@@ -280,7 +274,7 @@ static int sysfs_open_file(struct inode *inode, struct file *file)
         */
        if (file->f_mode & FMODE_WRITE) {
                if (!(inode->i_mode & S_IWUGO) || !ops->store)
-                       goto err_mput;
+                       goto err_out;
        }
 
        /* File needs read support.
@@ -289,7 +283,7 @@ static int sysfs_open_file(struct inode *inode, struct file *file)
         */
        if (file->f_mode & FMODE_READ) {
                if (!(inode->i_mode & S_IRUGO) || !ops->show)
-                       goto err_mput;
+                       goto err_out;
        }
 
        /* No error? Great, allocate a buffer for the file, and store it
@@ -298,7 +292,7 @@ static int sysfs_open_file(struct inode *inode, struct file *file)
        error = -ENOMEM;
        buffer = kzalloc(sizeof(struct sysfs_buffer), GFP_KERNEL);
        if (!buffer)
-               goto err_mput;
+               goto err_out;
 
        init_MUTEX(&buffer->sem);
        buffer->needs_read_fill = 1;
@@ -310,9 +304,7 @@ static int sysfs_open_file(struct inode *inode, struct file *file)
        sysfs_get(attr_sd);
        return 0;
 
- err_mput:
-       module_put(attr->owner);
- err_sput:
+ err_out:
        sysfs_put_active_two(attr_sd);
        return error;
 }
@@ -320,12 +312,9 @@ static int sysfs_open_file(struct inode *inode, struct file *file)
 static int sysfs_release(struct inode * inode, struct file * filp)
 {
        struct sysfs_dirent *attr_sd = filp->f_path.dentry->d_fsdata;
-       struct attribute *attr = attr_sd->s_elem.attr.attr;
        struct sysfs_buffer *buffer = filp->private_data;
 
        sysfs_put(attr_sd);
-       /* After this point, attr should not be accessed. */
-       module_put(attr->owner);
 
        if (buffer) {
                if (buffer->page)
index e699ab279c2c1302d03bdb25e10bd36567fbc507..e285746588d68baf4dccc894e70768005342e04a 100644 (file)
@@ -101,8 +101,7 @@ struct sysdev_attribute {
 
 #define _SYSDEV_ATTR(_name,_mode,_show,_store)                 \
 {                                                              \
-       .attr = { .name = __stringify(_name), .mode = _mode,    \
-                .owner = THIS_MODULE },                        \
+       .attr = { .name = __stringify(_name), .mode = _mode },  \
        .show   = _show,                                        \
        .store  = _store,                                       \
 }
index 2f86b080b39d0828c4a87f8e830ef42513d14064..161e19aa2b4f042928bcc4f2b26e674c3de9f051 100644 (file)
@@ -20,9 +20,13 @@ struct module;
 struct nameidata;
 struct dentry;
 
+/* FIXME
+ * The *owner field is no longer used, but leave around
+ * until the tree gets cleaned up fully.
+ */
 struct attribute {
        const char              * name;
-       struct module           * owner;
+       struct module           * owner;
        mode_t                  mode;
 };
 
@@ -39,14 +43,14 @@ struct attribute_group {
  */
 
 #define __ATTR(_name,_mode,_show,_store) { \
-       .attr = {.name = __stringify(_name), .mode = _mode, .owner = THIS_MODULE },     \
+       .attr = {.name = __stringify(_name), .mode = _mode },   \
        .show   = _show,                                        \
        .store  = _store,                                       \
 }
 
 #define __ATTR_RO(_name) { \
-       .attr   = { .name = __stringify(_name), .mode = 0444, .owner = THIS_MODULE },   \
-       .show   = _name##_show, \
+       .attr   = { .name = __stringify(_name), .mode = 0444 }, \
+       .show   = _name##_show,                                 \
 }
 
 #define __ATTR_NULL { .attr = { .name = NULL } }
index 9bd93de01f4a95ab6abb0729401bf424cf5fab21..015d60cfd90e4f67f07380fac6c05d44aec81580 100644 (file)
@@ -488,8 +488,7 @@ static void free_modinfo_##field(struct module *mod)                  \
         mod->field = NULL;                                            \
 }                                                                     \
 static struct module_attribute modinfo_##field = {                    \
-       .attr = { .name = __stringify(field), .mode = 0444,           \
-                 .owner = THIS_MODULE },                             \
+       .attr = { .name = __stringify(field), .mode = 0444 },         \
        .show = show_modinfo_##field,                                 \
        .setup = setup_modinfo_##field,                               \
        .test = modinfo_##field##_exists,                             \
@@ -793,7 +792,7 @@ static ssize_t show_refcnt(struct module_attribute *mattr,
 }
 
 static struct module_attribute refcnt = {
-       .attr = { .name = "refcnt", .mode = 0444, .owner = THIS_MODULE },
+       .attr = { .name = "refcnt", .mode = 0444 },
        .show = show_refcnt,
 };
 
@@ -851,7 +850,7 @@ static ssize_t show_initstate(struct module_attribute *mattr,
 }
 
 static struct module_attribute initstate = {
-       .attr = { .name = "initstate", .mode = 0444, .owner = THIS_MODULE },
+       .attr = { .name = "initstate", .mode = 0444 },
        .show = show_initstate,
 };
 
@@ -1032,7 +1031,6 @@ static void add_sect_attrs(struct module *mod, unsigned int nsect,
                sattr->mattr.show = module_sect_show;
                sattr->mattr.store = NULL;
                sattr->mattr.attr.name = sattr->name;
-               sattr->mattr.attr.owner = mod;
                sattr->mattr.attr.mode = S_IRUGO;
                *(gattr++) = &(sattr++)->mattr.attr;
        }
@@ -1090,7 +1088,6 @@ int module_add_modinfo_attrs(struct module *mod)
                if (!attr->test ||
                    (attr->test && attr->test(mod))) {
                        memcpy(temp_attr, attr, sizeof(*temp_attr));
-                       temp_attr->attr.owner = mod;
                        error = sysfs_create_file(&mod->mkobj.kobj,&temp_attr->attr);
                        ++temp_attr;
                }
index e61c46c97ce72ec1fb9615783e02dd4afb7c9990..effbaaedd7f328ac8a69bc246e60903b5babd271 100644 (file)
@@ -491,7 +491,6 @@ param_sysfs_setup(struct module_kobject *mk,
                        pattr->mattr.show = param_attr_show;
                        pattr->mattr.store = param_attr_store;
                        pattr->mattr.attr.name = (char *)&kp->name[name_skip];
-                       pattr->mattr.attr.owner = mk->mod;
                        pattr->mattr.attr.mode = kp->perm;
                        *(gattr++) = &(pattr++)->mattr.attr;
                }
index 33c6c4a7c689d76f25299c0cdb730d33315f8e73..31ace23a0914e3deadacce825d5e086712440653 100644 (file)
@@ -383,8 +383,7 @@ static ssize_t brforward_read(struct kobject *kobj, char *buf,
 
 static struct bin_attribute bridge_forward = {
        .attr = { .name = SYSFS_BRIDGE_FDB,
-                 .mode = S_IRUGO,
-                 .owner = THIS_MODULE, },
+                 .mode = S_IRUGO, },
        .read = brforward_read,
 };
 
index 2da22927d8dd158ea341fe53d896dc1f53ea52b6..79db51fcb4768dabb001c5afb17325c6ad00a634 100644 (file)
@@ -29,8 +29,7 @@ struct brport_attribute {
 #define BRPORT_ATTR(_name,_mode,_show,_store)                  \
 struct brport_attribute brport_attr_##_name = {                \
        .attr = {.name = __stringify(_name),                    \
-                .mode = _mode,                                 \
-                .owner = THIS_MODULE, },                       \
+                .mode = _mode },                               \
        .show   = _show,                                        \
        .store  = _store,                                       \
 };