x86: sysfs: kill owner field from attribute
authorParag Warudkar <parag.lkml@gmail.com>
Sun, 19 Oct 2008 03:28:50 +0000 (20:28 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 20 Oct 2008 15:52:42 +0000 (08:52 -0700)
Tejun's commit 7b595756ec1f49e0049a9e01a1298d53a7faaa15 made sysfs
attribute->owner unnecessary.  But the field was left in the structure to
ease the merge.  It's been over a year since that change and it is now
time to start killing attribute->owner along with its users - one arch at
a time!

This patch is attempt #1 to get rid of attribute->owner only for
CONFIG_X86_64 or CONFIG_X86_32 .  We will deal with other arches later on
as and when possible - avr32 will be the next since that is something I
can test.  Compile (make allyesconfig / make allmodconfig / custom config)
and boot tested.

akpm: the idea is that we put the declaration of sttribute.owner inside
`#ifndef CONFIG_X86'.  But that proved to be too ambitious for now because
new usages kept on turning up in subsystem trees.

[akpm: remove the ifdef for now]
Signed-off-by: Parag Warudkar <parag.lkml@gmail.com>
Cc: Greg KH <greg@kroah.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Tejun Heo <htejun@gmail.com>
Cc: Len Brown <lenb@kernel.org>
Cc: Jens Axboe <jens.axboe@oracle.com>
Cc: Jean Delvare <khali@linux-fr.org>
Cc: Roland Dreier <rolandd@cisco.com>
Cc: David Brownell <david-b@pacbell.net>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
20 files changed:
drivers/acpi/battery.c
drivers/acpi/sbs.c
drivers/acpi/system.c
drivers/block/aoe/aoeblk.c
drivers/block/nbd.c
drivers/firmware/iscsi_ibft.c
drivers/i2c/chips/at24.c
drivers/i2c/chips/ds1682.c
drivers/infiniband/core/cm.c
drivers/memstick/core/mspro_block.c
drivers/power/power_supply_sysfs.c
drivers/rtc/rtc-cmos.c
drivers/rtc/rtc-ds1305.c
drivers/rtc/rtc-ds1307.c
drivers/rtc/rtc-ds1511.c
drivers/rtc/rtc-m48t59.c
drivers/rtc/rtc-stk17ta8.c
drivers/scsi/arcmsr/arcmsr_attr.c
drivers/w1/slaves/w1_ds2760.c
include/linux/sysfs.h

index b1c723f9f58d1fce3861730870b58550fe13f6a2..70f7f60929ca552f87dfa819dd93296abd3cea60 100644 (file)
@@ -431,7 +431,7 @@ static ssize_t acpi_battery_alarm_store(struct device *dev,
 }
 
 static struct device_attribute alarm_attr = {
-       .attr = {.name = "alarm", .mode = 0644, .owner = THIS_MODULE},
+       .attr = {.name = "alarm", .mode = 0644},
        .show = acpi_battery_alarm_show,
        .store = acpi_battery_alarm_store,
 };
index 10a36512647ca6107a76c5982a5f3acaa140b571..7b011e7e29fe00b35ab1616d4c7a232c32ec8d2b 100644 (file)
@@ -463,7 +463,7 @@ static ssize_t acpi_battery_alarm_store(struct device *dev,
 }
 
 static struct device_attribute alarm_attr = {
-       .attr = {.name = "alarm", .mode = 0644, .owner = THIS_MODULE},
+       .attr = {.name = "alarm", .mode = 0644},
        .show = acpi_battery_alarm_show,
        .store = acpi_battery_alarm_store,
 };
index 91dec448b3edcd5055112a892f1c368433bc6281..24e80fd927e238a6e8ea60ebafe2d4ae57f5f2c1 100644 (file)
@@ -115,7 +115,6 @@ static void acpi_table_attr_init(struct acpi_table_attr *table_attr,
        table_attr->attr.read = acpi_table_show;
        table_attr->attr.attr.name = table_attr->name;
        table_attr->attr.attr.mode = 0444;
-       table_attr->attr.attr.owner = THIS_MODULE;
 
        return;
 }
index b82654e883a759f10d46dd67f311eab59a35fec6..d876ad861237d9367abdf3df8ef9606274d0ebfb 100644 (file)
@@ -90,7 +90,7 @@ static DEVICE_ATTR(state, S_IRUGO, aoedisk_show_state, NULL);
 static DEVICE_ATTR(mac, S_IRUGO, aoedisk_show_mac, NULL);
 static DEVICE_ATTR(netif, S_IRUGO, aoedisk_show_netif, NULL);
 static struct device_attribute dev_attr_firmware_version = {
-       .attr = { .name = "firmware-version", .mode = S_IRUGO, .owner = THIS_MODULE },
+       .attr = { .name = "firmware-version", .mode = S_IRUGO },
        .show = aoedisk_show_fwver,
 };
 
index 7b3351260d564015c203d9a2342b94d063eaaccb..9034ca585afd710d6425d53f7b6357c13357a6af 100644 (file)
@@ -391,7 +391,7 @@ static ssize_t pid_show(struct device *dev,
 }
 
 static struct device_attribute pid_attr = {
-       .attr = { .name = "pid", .mode = S_IRUGO, .owner = THIS_MODULE },
+       .attr = { .name = "pid", .mode = S_IRUGO},
        .show = pid_show,
 };
 
index deb154aa47c412be66f4ee68281f053cf7a4c241..4353414a0b770c368b938760e8630f50bd065346 100644 (file)
@@ -732,7 +732,6 @@ static int __init ibft_create_attribute(struct ibft_kobject *kobj_data,
 
        attr->attr.name = name;
        attr->attr.mode = S_IRUSR;
-       attr->attr.owner = THIS_MODULE;
 
        attr->hdr = hdr;
        attr->show = show;
index 2a4acb2695693b9b3108a6317301efbeef6e1416..d4775528abc69b2d4c4d580d712e48862ef7d1d7 100644 (file)
@@ -460,7 +460,6 @@ static int at24_probe(struct i2c_client *client, const struct i2c_device_id *id)
         */
        at24->bin.attr.name = "eeprom";
        at24->bin.attr.mode = chip.flags & AT24_FLAG_IRUGO ? S_IRUGO : S_IRUSR;
-       at24->bin.attr.owner = THIS_MODULE;
        at24->bin.read = at24_bin_read;
        at24->bin.size = chip.byte_len;
 
index 23be4d42cb02c48da998864f3d13da047e75092b..f3ee4a1abb7714fa2dca513043dce44947d8b962 100644 (file)
@@ -190,7 +190,6 @@ static struct bin_attribute ds1682_eeprom_attr = {
        .attr = {
                .name = "eeprom",
                .mode = S_IRUGO | S_IWUSR,
-               .owner = THIS_MODULE,
        },
        .size = DS1682_EEPROM_SIZE,
        .read = ds1682_eeprom_read,
index a78d35aecee3de339520308358d6ca565d69cdd1..f1e82a92e61ec09fb879a9b00ec41b5e35b192f4 100644 (file)
@@ -122,7 +122,7 @@ struct cm_counter_attribute {
 
 #define CM_COUNTER_ATTR(_name, _index) \
 struct cm_counter_attribute cm_##_name##_counter_attr = { \
-       .attr = { .name = __stringify(_name), .mode = 0444, .owner = THIS_MODULE }, \
+       .attr = { .name = __stringify(_name), .mode = 0444 }, \
        .index = _index \
 }
 
index 6e291bf8237adaa0d7c5ea84f8ffda8e9ee440e3..5263913e0c69e8935add96731944373ee968f01d 100644 (file)
@@ -1044,7 +1044,6 @@ static int mspro_block_read_attributes(struct memstick_dev *card)
 
                s_attr->dev_attr.attr.name = s_attr->name;
                s_attr->dev_attr.attr.mode = S_IRUGO;
-               s_attr->dev_attr.attr.owner = THIS_MODULE;
                s_attr->dev_attr.show = mspro_block_attr_show(s_attr->id);
 
                if (!rc)
index fe2aeb11939b3d9a327167e3d162043a6c0f9914..23ae8460f5c1a71f7b794745837799ac1fc21f25 100644 (file)
@@ -30,7 +30,7 @@
 
 #define POWER_SUPPLY_ATTR(_name)                                       \
 {                                                                      \
-       .attr = { .name = #_name, .mode = 0444, .owner = THIS_MODULE }, \
+       .attr = { .name = #_name, .mode = 0444 },       \
        .show = power_supply_show_property,                             \
        .store = NULL,                                                  \
 }
index 957365e4a746d9108eb3dcc2ee335481770ccd4f..5549231179a2dacb955357e69cd6b521d5e7954f 100644 (file)
@@ -592,7 +592,6 @@ static struct bin_attribute nvram = {
        .attr = {
                .name   = "nvram",
                .mode   = S_IRUGO | S_IWUSR,
-               .owner  = THIS_MODULE,
        },
 
        .read   = cmos_nvram_read,
index 57b470f3fc0b97444139806e933c7d00d8721df8..fc372df6534b5e93b3296913be692188cd5c1d41 100644 (file)
@@ -606,7 +606,6 @@ ds1305_nvram_write(struct kobject *kobj, struct bin_attribute *attr,
 static struct bin_attribute nvram = {
        .attr.name      = "nvram",
        .attr.mode      = S_IRUGO | S_IWUSR,
-       .attr.owner     = THIS_MODULE,
        .read           = ds1305_nvram_read,
        .write          = ds1305_nvram_write,
        .size           = DS1305_NVRAM_LEN,
index cad23bcfebd46af58574d6f933f2fccd53db8db1..162330b9d1dc0069ab94397e071d1d04e5c78865 100644 (file)
@@ -551,7 +551,6 @@ static struct bin_attribute nvram = {
        .attr = {
                .name   = "nvram",
                .mode   = S_IRUGO | S_IWUSR,
-               .owner  = THIS_MODULE,
        },
 
        .read   = ds1307_nvram_read,
index 7bb0a962ad2164cb4f617f3777ce562b4c182a28..25caada78398e76ee83d58507a6fed256eb306ef 100644 (file)
@@ -481,7 +481,6 @@ static struct bin_attribute ds1511_nvram_attr = {
        .attr = {
                .name = "nvram",
                .mode = S_IRUGO | S_IWUGO,
-               .owner = THIS_MODULE,
        },
        .size = DS1511_RAM_MAX,
        .read = ds1511_nvram_read,
index ed671e29e07d92292b4935c889ac3f73931f4744..04b63dab693254885893ea622a7cf99cebc1b3cf 100644 (file)
@@ -360,7 +360,6 @@ static struct bin_attribute m48t59_nvram_attr = {
        .attr = {
                .name = "nvram",
                .mode = S_IRUGO | S_IWUSR,
-               .owner = THIS_MODULE,
        },
        .read = m48t59_nvram_read,
        .write = m48t59_nvram_write,
index 0947f8c23957fdc3f6d8253f50c02f7958ff46e1..f4cd46e15af98830ac3c580c52563119e7bc103e 100644 (file)
@@ -280,7 +280,6 @@ static struct bin_attribute stk17ta8_nvram_attr = {
        .attr = {
                .name = "nvram",
                .mode = S_IRUGO | S_IWUSR,
-               .owner = THIS_MODULE,
        },
        .size = RTC_OFFSET,
        .read = stk17ta8_nvram_read,
index 69f8346aa288348a86a8d9885dbfd1759867c5ad..5877f29a600541d7acfaf44b8ea91fae8d74243c 100644 (file)
@@ -189,7 +189,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,
@@ -199,7 +198,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,
@@ -209,7 +207,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 ed6b0576208c27ca237670999ba328a267b350f9..1f09d4e4144c23598f3cf7560a28630fa9f6a6d3 100644 (file)
@@ -80,7 +80,6 @@ static struct bin_attribute w1_ds2760_bin_attr = {
        .attr = {
                .name = "w1_slave",
                .mode = S_IRUGO,
-               .owner = THIS_MODULE,
        },
        .size = DS2760_DATA_SIZE,
        .read = w1_ds2760_read_bin,
index b330e289d71f280f7bb6ca3af431a733039ac420..9d68fed50f119423904db7d7f608fd4baede5a82 100644 (file)
@@ -21,8 +21,9 @@ struct kobject;
 struct module;
 
 /* FIXME
- * The *owner field is no longer used, but leave around
- * until the tree gets cleaned up fully.
+ * The *owner field is no longer used.
+ * x86 tree has been cleaned up. The owner
+ * attribute is still left for other arches.
  */
 struct attribute {
        const char              *name;