summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* driver core: firmware: use __ATTR_RW()Greg Kroah-Hartman2013-08-241-8/+5
| | | | | | | Use __ATTR_RW() instead of __ATTR() to make it more obvious what the type of attribute is being created. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* driver core: core: use DEVICE_ATTR_ROGreg Kroah-Hartman2013-08-241-23/+16
| | | | | | | Use DEVICE_ATTR_RO() instead of a "raw" __ATTR macro, making it easier to audit exactly what is going on with the sysfs files. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* driver core: bus: use DRIVER_ATTR_WO()Greg Kroah-Hartman2013-08-241-9/+9
| | | | | | | | There are two bus attributes that can better be defined using DRIVER_ATTR_WO(), so convert them to the new macro, making it easier to audit attribute permissions. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* driver core: create write-only attribute macros for devices and driversGreg Kroah-Hartman2013-08-241-0/+4
| | | | | | | This creates the macros DRIVER_ATTR_WO() and DEVICE_ATTR_WO() for write-only attributes for drivers and devices. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* sysfs: create __ATTR_WO()Greg Kroah-Hartman2013-08-241-0/+5
| | | | | | | This creates the macro __ATTR_WO() for write-only attributes, instead of having to "open define" them. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* driver-core: platform: convert bus code to use dev_groupsGreg Kroah-Hartman2013-08-231-4/+6
| | | | | | | | The dev_attrs field of struct bus_type is going away soon, dev_groups should be used instead. This converts the platform bus code to use the correct field. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* workqueue: convert bus code to use dev_groupsGreg Kroah-Hartman2013-08-231-12/+15
| | | | | | | | | The dev_attrs field of struct bus_type is going away soon, dev_groups should be used instead. This converts the workqueue bus code to use the correct field. Acked-by: Tejun Heo <tj@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* MEI: convert bus code to use dev_groupsGreg Kroah-Hartman2013-08-231-4/+6
| | | | | | | | | | The dev_attrs field of struct bus_type is going away soon, dev_groups should be used instead. This converts the MEI bus code to use the correct field. Acked-by: Tomas Winkler <tomas.winkler@intel.com> Cc: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* USB: serial: convert bus code to use drv_groupsGreg Kroah-Hartman2013-08-231-6/+8
| | | | | | | | The drv_attrs field of struct bus_type is going away soon, drv_groups should be used instead. This converts the USB serial bus code to use the correct field. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Kconfig: Remove hotplug enable hints in CONFIG_KEXEC help textsGeert Uytterhoeven2013-08-226-17/+16
| | | | | | | | | | | | | commit 40b313608ad4ea655addd2ec6cdd106477ae8e15 ("Finally eradicate CONFIG_HOTPLUG") removed remaining references to CONFIG_HOTPLUG, but missed a few plain English references in the CONFIG_KEXEC help texts. Remove them, too. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: Stephen Rothwell <sfr@canb.auug.org.au> Acked-by: Ingo Molnar <mingo@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* w1: slaves: w1_ds2781: convert to use w1_family_ops.groupsGreg Kroah-Hartman2013-08-221-18/+18
| | | | | | | | | | | This moves the sysfs file creation/removal to the w1 core by using the .groups field, saving code in the slave driver. Acked-by: Evgeniy Polyakov <zbr@ioremap.net> Cc: Alexander Stein <alexander.stein@informatik.tu-chemnitz.de> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* w1: slaves: w1_ds2760: convert to use w1_family_ops.groupsGreg Kroah-Hartman2013-08-221-17/+18
| | | | | | | | | | | This moves the sysfs file creation/removal to the w1 core by using the .groups field, saving code in the slave driver. Acked-by: Evgeniy Polyakov <zbr@ioremap.net> Cc: Alexander Stein <alexander.stein@informatik.tu-chemnitz.de> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* w1: slaves: w1_ds2780: convert to use w1_family_ops.groupsGreg Kroah-Hartman2013-08-221-18/+18
| | | | | | | | | | | This moves the sysfs file creation/removal to the w1 core by using the .groups field, saving code in the slave driver. Acked-by: Evgeniy Polyakov <zbr@ioremap.net> Cc: Alexander Stein <alexander.stein@informatik.tu-chemnitz.de> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* w1: slaves: w1_ds28e04: convert to use w1_family_ops.groupsGreg Kroah-Hartman2013-08-221-70/+42
| | | | | | | | | This moves the sysfs file creation/removal to the w1 core by using the .groups field, saving code in the slave driver. Acked-by: Evgeniy Polyakov <zbr@ioremap.net> Cc: Alexander Stein <alexander.stein@informatik.tu-chemnitz.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* w1: slaves: w1_ds2433: convert to use w1_family_ops.groupsGreg Kroah-Hartman2013-08-221-25/+22
| | | | | | | | | This moves the sysfs file creation/removal to the w1 core by using the .groups field, saving code in the slave driver. Acked-by: Evgeniy Polyakov <zbr@ioremap.net> Cc: Alexander Stein <alexander.stein@informatik.tu-chemnitz.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* w1: slaves: w1_ds2431: convert to use w1_family_ops.groupsGreg Kroah-Hartman2013-08-221-24/+19
| | | | | | | | | This moves the sysfs file creation/removal to the w1 core by using the .groups field, saving code in the slave driver. Acked-by: Evgeniy Polyakov <zbr@ioremap.net> Cc: Alexander Stein <alexander.stein@informatik.tu-chemnitz.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* w1: slaves: w1_ds2423: convert to use w1_family_ops.groupsGreg Kroah-Hartman2013-08-221-18/+9
| | | | | | | | | This moves the sysfs file creation/removal to the w1 core by using the .groups field, saving code in the slave driver. Acked-by: Evgeniy Polyakov <zbr@ioremap.net> Cc: Alexander Stein <alexander.stein@informatik.tu-chemnitz.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* w1: slaves: w1_ds2413.c: convert to use w1_family_ops.groupsGreg Kroah-Hartman2013-08-221-50/+22
| | | | | | | | | | | This moves the sysfs file creation/removal to the w1 core by using the .groups field, saving code in the slave driver. Acked-by: Evgeniy Polyakov <zbr@ioremap.net> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Alexander Stein <alexander.stein@informatik.tu-chemnitz.de> Cc: Mariusz Bialonczyk <manio@skyboo.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* w1: slaves: w1_ds2408: convert to use w1_family_ops.groupsGreg Kroah-Hartman2013-08-221-122/+52
| | | | | | | | | | | This moves the sysfs file creation/removal to the w1 core by using the .groups field, saving code in the slave driver. Acked-by: Evgeniy Polyakov <zbr@ioremap.net> Cc: Jean-Francois Dagenais <jeff.dagenais@gmail.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Alexander Stein <alexander.stein@informatik.tu-chemnitz.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* w1: slaves: w1_therm: convert to use w1_family_ops.groupsGreg Kroah-Hartman2013-08-221-15/+9
| | | | | | | | | | | This moves the sysfs file creation/removal to the w1 core by using the .groups field, saving code in the slave driver. Acked-by: Evgeniy Polyakov <zbr@ioremap.net> Cc: David Stevenson <david@avoncliff.com> Cc: Alexander Stein <alexander.stein@informatik.tu-chemnitz.de> Cc: Michael Arndt <michael@scriptkiller.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* w1: add attribute groups to struct w1_family_opsGreg Kroah-Hartman2013-08-222-32/+42
| | | | | | | | | This lets w1 slave drivers declare an attribute group, and not have to create/destroy sysfs files directly. All w1 slave drivers will be fixed to use this field up in follow-on patches to this one. Acked-by: Evgeniy Polyakov <zbr@ioremap.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* w1: use default attribute groups for w1 slave devicesGreg Kroah-Hartman2013-08-221-27/+11
| | | | | | | | | As we have 2 sysfs files for the w1 slave devices, let the driver core create / destroy them automatically by setting the default attribute group for them, saving code and housekeeping logic. Acked-by: Evgeniy Polyakov <zbr@ioremap.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* w1: remove race with sysfs file creationGreg Kroah-Hartman2013-08-221-38/+73
| | | | | | | | | | W1 slave sysfs files are created _after_ userspace is notified that the device has been added to the system. Fix that race by moving the creation/remove of the files to the bus notifier that is there for doing this type of thing. Acked-by: Evgeniy Polyakov <zbr@ioremap.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* sysfs.h: remove attr_name() macroGreg Kroah-Hartman2013-08-225-15/+13
| | | | | | | | | | | Gotta love a macro that doesn't reduce the typing you have to do. Also, only the driver core, and one network driver uses this. The driver core functions will be going away soon, and I'll convert the network driver soon to not need this as well, so delete it for now before anyone else gets some bright ideas and wants to use it. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* sysfs: group.c: fix up kerneldocGreg Kroah-Hartman2013-08-221-2/+2
| | | | | | | Fix up the wording of sysfs_create/remove_groups() a bit. Reported-by: Anthony Foiani <tkil@scrye.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* acpi: bgrt: fix build error due to attribute changeGreg Kroah-Hartman2013-08-221-1/+0
| | | | | | | | | | | No need to call sysfs_bin_attr_init, as the attribute is not dynamically created. Also, we renamed the attribute, so this one isn't even valid anymore. Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Cc: Len Brown <lenb@kernel.org> Cc: "Rafael J. Wysocki" <rjw@sisk.pl> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* sysfs: fix up minor coding style issues in sysfs.hGreg Kroah-Hartman2013-08-221-6/+6
| | | | | | | As long as we are cleaning up sysfs coding style issues, don't forget the main sysfs.h file, so fix up the space issues there as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* sysfs: sysfs.h: fix coding style issuesGreg Kroah-Hartman2013-08-221-8/+10
| | | | | | This fixes up the remaining coding style issues in sysfs.h Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* sysfs: file.c: fix up broken string warningsGreg Kroah-Hartman2013-08-221-4/+6
| | | | | | | This fixes the coding style warnings in fs/sysfs/file.c for broken strings across lines. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* sysfs: dir.c: fix up odd do/while indentationGreg Kroah-Hartman2013-08-221-7/+8
| | | | | | This fixes up the odd do/while after an if statement warning in dir.c Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* sysfs: fix up uaccess.h coding style warningsGreg Kroah-Hartman2013-08-222-3/+2
| | | | | | This fixes the uaccess.h warnings in the sysfs.c files. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* sysfs: fix up 80 column coding style issuesGreg Kroah-Hartman2013-08-224-10/+15
| | | | | | This fixes up the 80 column coding style issues in the sysfs .c files. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* sysfs: fix up space coding style issuesGreg Kroah-Hartman2013-08-226-36/+36
| | | | | | | This fixes up all of the space-related coding style issues for the sysfs code. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* sysfs: remove trailing whitespaceGreg Kroah-Hartman2013-08-224-15/+13
| | | | | | This removes all trailing whitespace errors in the sysfs code. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* sysfs: fix placement of EXPORT_SYMBOL()Greg Kroah-Hartman2013-08-223-20/+8
| | | | | | | The export should happen after the function, not at the bottom of the file, so fix that up. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* sysfs: group: update copyright to add myself and the LFGreg Kroah-Hartman2013-08-221-0/+2
| | | | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* sysfs: group.c: add kerneldoc for sysfs_remove_groupGreg Kroah-Hartman2013-08-221-2/+10
| | | | | | | | sysfs_remove_group() never had kerneldoc, so add it, and fix up the kerneldoc for sysfs_remove_groups() which didn't specify the parameters properly. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* sysfs: group.c: fix up broken string coding styleGreg Kroah-Hartman2013-08-221-2/+3
| | | | | | | checkpatch complains about the broken string in the file, and it's correct, so fix it up. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* sysfs: group.c: fix up some * coding style issuesGreg Kroah-Hartman2013-08-221-6/+6
| | | | | | This fixes up the * coding style warnings for the group.c sysfs file. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* sysfs: group.c: fix trailing whitespaceGreg Kroah-Hartman2013-08-221-2/+2
| | | | | | There was some trailing spaces in the file, fix that up. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* sysfs: group.c: move EXPORT_SYMBOL_GPL() to the proper locationGreg Kroah-Hartman2013-08-221-6/+3
| | | | | | | | This fixes up the coding style issue of incorrectly placing the EXPORT_SYMBOL_GPL() macro, it should be right after the function itself, not at the end of the file. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* sysfs: add sysfs_create/remove_groups()Greg Kroah-Hartman2013-08-225-61/+64
| | | | | | | | | These functions are being open-coded in 3 different places in the driver core, and other driver subsystems will want to start doing this as well, so move it to the sysfs core to keep it all in one place, where we know it is written properly. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* drivers: base: use standard device online/offline for state changeSeth Jennings2013-08-212-82/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are two ways to set the online/offline state for a memory block: echo 0|1 > online and echo online|online_kernel|online_movable|offline > state. The state attribute can online a memory block with extra data, the "online type", where the online attribute uses a default online type of ONLINE_KEEP, same as echo online > state. Currently there is a state_mutex that provides consistency between the memory block state and the underlying memory. The problem is that this code does a lot of things that the common device layer can do for us, such as the serialization of the online/offline handlers using the device lock, setting the dev->offline field, and calling kobject_uevent(). This patch refactors the online/offline code to allow the common device_[online|offline] functions to be used. The result is a simpler and more common code path for the two state setting mechanisms. It also removes the state_mutex from the struct memory_block as the memory block device lock provides the state consistency. No functional change is intended by this patch. Signed-off-by: Seth Jennings <sjenning@linux.vnet.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* drivers: base: refactor add_memory_section() to add_memory_block()Seth Jennings2013-08-211-27/+21
| | | | | | | | | | | | Right now memory_dev_init() maintains the memory block pointer between iterations of add_memory_section(). This is nasty. This patch refactors add_memory_section() to become add_memory_block(). The refactoring pulls the section scanning out of memory_dev_init() and simplifies the signature. Signed-off-by: Seth Jennings <sjenning@linux.vnet.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* drivers: base: remove improper get/put in add_memory_section()Seth Jennings2013-08-211-4/+2
| | | | | | | | | | | | | | | The path through add_memory_section() when the memory block already exists uses flawed refcounting logic. A get_device() is done on a memory block using a pointer that might not be valid as we dropped our previous reference and didn't obtain a new reference in the proper way. Lets stop pretending and just remove the get/put. The mem_sysfs_mutex, which we hold over the entire init loop now, will prevent the memory blocks from disappearing from under us. Signed-off-by: Seth Jennings <sjenning@linux.vnet.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* drivers: base: reduce add_memory_section() for boot-time onlySeth Jennings2013-08-212-28/+14
| | | | | | | | Now that add_memory_section() is only called from boot time, reduce the logic and remove the enum. Signed-off-by: Seth Jennings <sjenning@linux.vnet.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* drivers: base: unshare add_memory_section() from hotplugSeth Jennings2013-08-211-3/+16
| | | | | | | | | | | | | | add_memory_section() is currently called from both boot time and run time via hotplug and there is a lot of nastiness to allow for shared code including an enum parameter to convey the calling context to add_memory_section(). This patch is the first step in breaking up the messy code sharing by pulling the hotplug path for add_memory_section() directly into register_new_memory(). Signed-off-by: Seth Jennings <sjenning@linux.vnet.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* drivers: base: use device get/put functionsSeth Jennings2013-08-211-4/+4
| | | | | | | | | Use the [get|put]_device functions for ref'ing the memory block device rather than the kobject functions which should be hidden away by the device layer. Signed-off-by: Seth Jennings <sjenning@linux.vnet.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* drivers: base: remove unneeded variableSeth Jennings2013-08-211-4/+1
| | | | | | | The error variable is not needed. Signed-off-by: Seth Jennings <sjenning@linux.vnet.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* drivers: base: move mutex lock out of add_memory_section()Seth Jennings2013-08-211-4/+9
| | | | | | | | There is no point in releasing the mutex for each section that is added during boot time. Just hold it over the entire initialization loop. Signed-off-by: Seth Jennings <sjenning@linux.vnet.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>