diff options
author | David Brownell <dbrownell@users.sourceforge.net> | 2008-04-28 01:03:20 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-04-30 16:52:48 -0700 |
commit | 4356d73d028ad0726cfaf31ad30c5d28fcd98795 (patch) | |
tree | 4ca02a5ac47e6da7857c6a0caf93d06c9916f96c /drivers/pcmcia/socket_sysfs.c | |
parent | 4f452e8aa492c0b8028ca9b4bdb4d018ba28c6c7 (diff) | |
download | linux-4356d73d028ad0726cfaf31ad30c5d28fcd98795.tar.bz2 |
pcmcia: remove pccard_sysfs_interface warnings
Make the PCMCIA core stop using class_interface to hide socket attribute
registration. This removes the associated section mismatch warnings, and
helps get to the point where that mechanism can finally be removed.
Simplify that attribute registration by using an attribute_group.
This is a net shrink in object size.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/pcmcia/socket_sysfs.c')
-rw-r--r-- | drivers/pcmcia/socket_sysfs.c | 52 |
1 files changed, 21 insertions, 31 deletions
diff --git a/drivers/pcmcia/socket_sysfs.c b/drivers/pcmcia/socket_sysfs.c index b4409002b7f8..562384d6f321 100644 --- a/drivers/pcmcia/socket_sysfs.c +++ b/drivers/pcmcia/socket_sysfs.c @@ -356,19 +356,23 @@ static ssize_t pccard_store_cis(struct kobject *kobj, } -static struct device_attribute *pccard_socket_attributes[] = { - &dev_attr_card_type, - &dev_attr_card_voltage, - &dev_attr_card_vpp, - &dev_attr_card_vcc, - &dev_attr_card_insert, - &dev_attr_card_pm_state, - &dev_attr_card_eject, - &dev_attr_card_irq_mask, - &dev_attr_available_resources_setup_done, +static struct attribute *pccard_socket_attributes[] = { + &dev_attr_card_type.attr, + &dev_attr_card_voltage.attr, + &dev_attr_card_vpp.attr, + &dev_attr_card_vcc.attr, + &dev_attr_card_insert.attr, + &dev_attr_card_pm_state.attr, + &dev_attr_card_eject.attr, + &dev_attr_card_irq_mask.attr, + &dev_attr_available_resources_setup_done.attr, NULL, }; +static const struct attribute_group socket_attrs = { + .attrs = pccard_socket_attributes, +}; + static struct bin_attribute pccard_cis_attr = { .attr = { .name = "cis", .mode = S_IRUGO | S_IWUSR }, .size = 0x200, @@ -376,35 +380,21 @@ static struct bin_attribute pccard_cis_attr = { .write = pccard_store_cis, }; -static int __devinit pccard_sysfs_add_socket(struct device *dev, - struct class_interface *class_intf) +int pccard_sysfs_add_socket(struct device *dev) { - struct device_attribute **attr; int ret = 0; - for (attr = pccard_socket_attributes; *attr; attr++) { - ret = device_create_file(dev, *attr); + ret = sysfs_create_group(&dev->kobj, &socket_attrs); + if (!ret) { + ret = sysfs_create_bin_file(&dev->kobj, &pccard_cis_attr); if (ret) - break; + sysfs_remove_group(&dev->kobj, &socket_attrs); } - if (!ret) - ret = sysfs_create_bin_file(&dev->kobj, &pccard_cis_attr); - return ret; } -static void __devexit pccard_sysfs_remove_socket(struct device *dev, - struct class_interface *class_intf) +void pccard_sysfs_remove_socket(struct device *dev) { - struct device_attribute **attr; - sysfs_remove_bin_file(&dev->kobj, &pccard_cis_attr); - for (attr = pccard_socket_attributes; *attr; attr++) - device_remove_file(dev, *attr); + sysfs_remove_group(&dev->kobj, &socket_attrs); } - -struct class_interface pccard_sysfs_interface = { - .class = &pcmcia_socket_class, - .add_dev = &pccard_sysfs_add_socket, - .remove_dev = __devexit_p(&pccard_sysfs_remove_socket), -}; |