Commit 01e8ef11 authored by Parag Warudkar's avatar Parag Warudkar Committed by Linus Torvalds

x86: sysfs: kill owner field from attribute

Tejun's commit 7b595756 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: default avatarParag 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: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent bb26b963
...@@ -431,7 +431,7 @@ static ssize_t acpi_battery_alarm_store(struct device *dev, ...@@ -431,7 +431,7 @@ static ssize_t acpi_battery_alarm_store(struct device *dev,
} }
static struct device_attribute alarm_attr = { static struct device_attribute alarm_attr = {
.attr = {.name = "alarm", .mode = 0644, .owner = THIS_MODULE}, .attr = {.name = "alarm", .mode = 0644},
.show = acpi_battery_alarm_show, .show = acpi_battery_alarm_show,
.store = acpi_battery_alarm_store, .store = acpi_battery_alarm_store,
}; };
......
...@@ -463,7 +463,7 @@ static ssize_t acpi_battery_alarm_store(struct device *dev, ...@@ -463,7 +463,7 @@ static ssize_t acpi_battery_alarm_store(struct device *dev,
} }
static struct device_attribute alarm_attr = { static struct device_attribute alarm_attr = {
.attr = {.name = "alarm", .mode = 0644, .owner = THIS_MODULE}, .attr = {.name = "alarm", .mode = 0644},
.show = acpi_battery_alarm_show, .show = acpi_battery_alarm_show,
.store = acpi_battery_alarm_store, .store = acpi_battery_alarm_store,
}; };
......
...@@ -115,7 +115,6 @@ static void acpi_table_attr_init(struct acpi_table_attr *table_attr, ...@@ -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.read = acpi_table_show;
table_attr->attr.attr.name = table_attr->name; table_attr->attr.attr.name = table_attr->name;
table_attr->attr.attr.mode = 0444; table_attr->attr.attr.mode = 0444;
table_attr->attr.attr.owner = THIS_MODULE;
return; return;
} }
......
...@@ -90,7 +90,7 @@ static DEVICE_ATTR(state, S_IRUGO, aoedisk_show_state, NULL); ...@@ -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(mac, S_IRUGO, aoedisk_show_mac, NULL);
static DEVICE_ATTR(netif, S_IRUGO, aoedisk_show_netif, NULL); static DEVICE_ATTR(netif, S_IRUGO, aoedisk_show_netif, NULL);
static struct device_attribute dev_attr_firmware_version = { 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, .show = aoedisk_show_fwver,
}; };
......
...@@ -391,7 +391,7 @@ static ssize_t pid_show(struct device *dev, ...@@ -391,7 +391,7 @@ static ssize_t pid_show(struct device *dev,
} }
static struct device_attribute pid_attr = { static struct device_attribute pid_attr = {
.attr = { .name = "pid", .mode = S_IRUGO, .owner = THIS_MODULE }, .attr = { .name = "pid", .mode = S_IRUGO},
.show = pid_show, .show = pid_show,
}; };
......
...@@ -732,7 +732,6 @@ static int __init ibft_create_attribute(struct ibft_kobject *kobj_data, ...@@ -732,7 +732,6 @@ static int __init ibft_create_attribute(struct ibft_kobject *kobj_data,
attr->attr.name = name; attr->attr.name = name;
attr->attr.mode = S_IRUSR; attr->attr.mode = S_IRUSR;
attr->attr.owner = THIS_MODULE;
attr->hdr = hdr; attr->hdr = hdr;
attr->show = show; attr->show = show;
......
...@@ -460,7 +460,6 @@ static int at24_probe(struct i2c_client *client, const struct i2c_device_id *id) ...@@ -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.name = "eeprom";
at24->bin.attr.mode = chip.flags & AT24_FLAG_IRUGO ? S_IRUGO : S_IRUSR; 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.read = at24_bin_read;
at24->bin.size = chip.byte_len; at24->bin.size = chip.byte_len;
......
...@@ -190,7 +190,6 @@ static struct bin_attribute ds1682_eeprom_attr = { ...@@ -190,7 +190,6 @@ static struct bin_attribute ds1682_eeprom_attr = {
.attr = { .attr = {
.name = "eeprom", .name = "eeprom",
.mode = S_IRUGO | S_IWUSR, .mode = S_IRUGO | S_IWUSR,
.owner = THIS_MODULE,
}, },
.size = DS1682_EEPROM_SIZE, .size = DS1682_EEPROM_SIZE,
.read = ds1682_eeprom_read, .read = ds1682_eeprom_read,
......
...@@ -122,7 +122,7 @@ struct cm_counter_attribute { ...@@ -122,7 +122,7 @@ struct cm_counter_attribute {
#define CM_COUNTER_ATTR(_name, _index) \ #define CM_COUNTER_ATTR(_name, _index) \
struct cm_counter_attribute cm_##_name##_counter_attr = { \ 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 = _index \
} }
......
...@@ -1044,7 +1044,6 @@ static int mspro_block_read_attributes(struct memstick_dev *card) ...@@ -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.name = s_attr->name;
s_attr->dev_attr.attr.mode = S_IRUGO; 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); s_attr->dev_attr.show = mspro_block_attr_show(s_attr->id);
if (!rc) if (!rc)
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#define POWER_SUPPLY_ATTR(_name) \ #define POWER_SUPPLY_ATTR(_name) \
{ \ { \
.attr = { .name = #_name, .mode = 0444, .owner = THIS_MODULE }, \ .attr = { .name = #_name, .mode = 0444 }, \
.show = power_supply_show_property, \ .show = power_supply_show_property, \
.store = NULL, \ .store = NULL, \
} }
......
...@@ -592,7 +592,6 @@ static struct bin_attribute nvram = { ...@@ -592,7 +592,6 @@ static struct bin_attribute nvram = {
.attr = { .attr = {
.name = "nvram", .name = "nvram",
.mode = S_IRUGO | S_IWUSR, .mode = S_IRUGO | S_IWUSR,
.owner = THIS_MODULE,
}, },
.read = cmos_nvram_read, .read = cmos_nvram_read,
......
...@@ -606,7 +606,6 @@ ds1305_nvram_write(struct kobject *kobj, struct bin_attribute *attr, ...@@ -606,7 +606,6 @@ ds1305_nvram_write(struct kobject *kobj, struct bin_attribute *attr,
static struct bin_attribute nvram = { static struct bin_attribute nvram = {
.attr.name = "nvram", .attr.name = "nvram",
.attr.mode = S_IRUGO | S_IWUSR, .attr.mode = S_IRUGO | S_IWUSR,
.attr.owner = THIS_MODULE,
.read = ds1305_nvram_read, .read = ds1305_nvram_read,
.write = ds1305_nvram_write, .write = ds1305_nvram_write,
.size = DS1305_NVRAM_LEN, .size = DS1305_NVRAM_LEN,
......
...@@ -551,7 +551,6 @@ static struct bin_attribute nvram = { ...@@ -551,7 +551,6 @@ static struct bin_attribute nvram = {
.attr = { .attr = {
.name = "nvram", .name = "nvram",
.mode = S_IRUGO | S_IWUSR, .mode = S_IRUGO | S_IWUSR,
.owner = THIS_MODULE,
}, },
.read = ds1307_nvram_read, .read = ds1307_nvram_read,
......
...@@ -481,7 +481,6 @@ static struct bin_attribute ds1511_nvram_attr = { ...@@ -481,7 +481,6 @@ static struct bin_attribute ds1511_nvram_attr = {
.attr = { .attr = {
.name = "nvram", .name = "nvram",
.mode = S_IRUGO | S_IWUGO, .mode = S_IRUGO | S_IWUGO,
.owner = THIS_MODULE,
}, },
.size = DS1511_RAM_MAX, .size = DS1511_RAM_MAX,
.read = ds1511_nvram_read, .read = ds1511_nvram_read,
......
...@@ -360,7 +360,6 @@ static struct bin_attribute m48t59_nvram_attr = { ...@@ -360,7 +360,6 @@ static struct bin_attribute m48t59_nvram_attr = {
.attr = { .attr = {
.name = "nvram", .name = "nvram",
.mode = S_IRUGO | S_IWUSR, .mode = S_IRUGO | S_IWUSR,
.owner = THIS_MODULE,
}, },
.read = m48t59_nvram_read, .read = m48t59_nvram_read,
.write = m48t59_nvram_write, .write = m48t59_nvram_write,
......
...@@ -280,7 +280,6 @@ static struct bin_attribute stk17ta8_nvram_attr = { ...@@ -280,7 +280,6 @@ static struct bin_attribute stk17ta8_nvram_attr = {
.attr = { .attr = {
.name = "nvram", .name = "nvram",
.mode = S_IRUGO | S_IWUSR, .mode = S_IRUGO | S_IWUSR,
.owner = THIS_MODULE,
}, },
.size = RTC_OFFSET, .size = RTC_OFFSET,
.read = stk17ta8_nvram_read, .read = stk17ta8_nvram_read,
......
...@@ -189,7 +189,6 @@ static struct bin_attribute arcmsr_sysfs_message_read_attr = { ...@@ -189,7 +189,6 @@ static struct bin_attribute arcmsr_sysfs_message_read_attr = {
.attr = { .attr = {
.name = "mu_read", .name = "mu_read",
.mode = S_IRUSR , .mode = S_IRUSR ,
.owner = THIS_MODULE,
}, },
.size = 1032, .size = 1032,
.read = arcmsr_sysfs_iop_message_read, .read = arcmsr_sysfs_iop_message_read,
...@@ -199,7 +198,6 @@ static struct bin_attribute arcmsr_sysfs_message_write_attr = { ...@@ -199,7 +198,6 @@ static struct bin_attribute arcmsr_sysfs_message_write_attr = {
.attr = { .attr = {
.name = "mu_write", .name = "mu_write",
.mode = S_IWUSR, .mode = S_IWUSR,
.owner = THIS_MODULE,
}, },
.size = 1032, .size = 1032,
.write = arcmsr_sysfs_iop_message_write, .write = arcmsr_sysfs_iop_message_write,
...@@ -209,7 +207,6 @@ static struct bin_attribute arcmsr_sysfs_message_clear_attr = { ...@@ -209,7 +207,6 @@ static struct bin_attribute arcmsr_sysfs_message_clear_attr = {
.attr = { .attr = {
.name = "mu_clear", .name = "mu_clear",
.mode = S_IWUSR, .mode = S_IWUSR,
.owner = THIS_MODULE,
}, },
.size = 1, .size = 1,
.write = arcmsr_sysfs_iop_message_clear, .write = arcmsr_sysfs_iop_message_clear,
......
...@@ -80,7 +80,6 @@ static struct bin_attribute w1_ds2760_bin_attr = { ...@@ -80,7 +80,6 @@ static struct bin_attribute w1_ds2760_bin_attr = {
.attr = { .attr = {
.name = "w1_slave", .name = "w1_slave",
.mode = S_IRUGO, .mode = S_IRUGO,
.owner = THIS_MODULE,
}, },
.size = DS2760_DATA_SIZE, .size = DS2760_DATA_SIZE,
.read = w1_ds2760_read_bin, .read = w1_ds2760_read_bin,
......
...@@ -21,8 +21,9 @@ struct kobject; ...@@ -21,8 +21,9 @@ struct kobject;
struct module; struct module;
/* FIXME /* FIXME
* The *owner field is no longer used, but leave around * The *owner field is no longer used.
* until the tree gets cleaned up fully. * x86 tree has been cleaned up. The owner
* attribute is still left for other arches.
*/ */
struct attribute { struct attribute {
const char *name; const char *name;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment