jbaron@akamai.com [Tue, 27 Aug 2013 16:50:03 +0000 (16:50 +0000)]
dynamic debug: line queries failing due to uninitialized local variable
Settings of the form, 'line x module y +p', can fail arbitrarily due to an
uninitialized local variable. With this patch results are consistent, as
expected.
Signed-off-by: Jason Baron <jbaron@akamai.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Greg Kroah-Hartman [Wed, 28 Aug 2013 16:51:41 +0000 (09:51 -0700)]
sysfs: sysfs_create_groups returns a value.
When I included the "empty" function for sysfs_create_groups() when
CONFIG_SYSFS=n, I forgot to return a value for it, so things blew up the
build. This patch fixes that, stupid me.
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Johannes Berg [Mon, 26 Aug 2013 07:58:30 +0000 (09:58 +0200)]
debugfs: provide debugfs_create_x64() when disabled
commit
15b0beaa332b3923cc ("Add x64 support to debugfs") added
debugfs_create_x64(), but forgot to provide it when debugfs is
disabled, causing problems when code tries to use it even then.
Provide the appropriate static inline.
Cc: Huang Ying <ying.huang@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Greg Kroah-Hartman [Fri, 23 Aug 2013 21:24:28 +0000 (14:24 -0700)]
rbd: convert bus code to use bus_groups
The bus_attrs field of struct bus_type is going away soon, dev_groups
should be used instead. This converts the RBD bus code to use the
correct field.
Cc: Yehuda Sadeh <yehuda@inktank.com>
Cc: Sage Weil <sage@inktank.com>
Acked-by: Alex Elder <elder@linaro.org>
Cc: <ceph-devel@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Greg KH [Wed, 21 Aug 2013 00:17:57 +0000 (17:17 -0700)]
firmware: dcdbas: use binary attribute groups
The dcdbas code was "hand rolling" a binary attribute group, which the
driver core now supports automatically. So remove the "create the files
by hand" logic, and just set the proper field in the attribute group
structure, saving lots of code and headache.
Cc: Doug Warzecha <Douglas_Warzecha@dell.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
--
Doug, I can take this through my driver-core tree if you don't object.
drivers/firmware/dcdbas.c | 19 ++-----------------
1 file changed, 2 insertions(+), 17 deletions(-)
Greg Kroah-Hartman [Wed, 28 Aug 2013 00:24:49 +0000 (17:24 -0700)]
sysfs: add sysfs_create/remove_groups for when SYSFS is not enabled
We need these functions for when CONFIG_SYSFS=n.
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Greg Kroah-Hartman [Tue, 27 Aug 2013 17:24:15 +0000 (10:24 -0700)]
driver core: add #include <linux/sysfs.h> to core files.
This is needed to fix the build on sh systems.
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Greg Kroah-Hartman [Fri, 23 Aug 2013 21:24:38 +0000 (14:24 -0700)]
HID: convert bus code to use dev_groups
The dev_attrs field of struct bus_type is going away soon, dev_groups
should be used instead. This converts the HID bus code to use
the correct field.
Acked-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Greg Kroah-Hartman [Fri, 23 Aug 2013 21:24:34 +0000 (14:24 -0700)]
Input: serio: convert bus code to use drv_groups
The drv_attrs field of struct bus_type is going away soon, drv_groups
should be used instead. This converts the serio bus code to use the
correct field.
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Greg Kroah-Hartman [Fri, 23 Aug 2013 21:24:33 +0000 (14:24 -0700)]
Input: gameport: convert bus code to use drv_groups
The drv_attrs field of struct bus_type is going away soon, drv_groups
should be used instead. This converts the gameport bus code to use the
correct field.
Acked: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Greg Kroah-Hartman [Sat, 24 Aug 2013 00:08:48 +0000 (17:08 -0700)]
driver core: firmware: use __ATTR_RW()
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>
Greg Kroah-Hartman [Sat, 24 Aug 2013 00:07:26 +0000 (17:07 -0700)]
driver core: core: use DEVICE_ATTR_RO
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>
Greg Kroah-Hartman [Fri, 23 Aug 2013 22:04:42 +0000 (15:04 -0700)]
driver core: bus: use DRIVER_ATTR_WO()
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>
Greg Kroah-Hartman [Fri, 23 Aug 2013 22:02:56 +0000 (15:02 -0700)]
driver core: create write-only attribute macros for devices and drivers
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>
Greg Kroah-Hartman [Fri, 23 Aug 2013 22:02:01 +0000 (15:02 -0700)]
sysfs: create __ATTR_WO()
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>
Greg Kroah-Hartman [Fri, 23 Aug 2013 21:24:37 +0000 (14:24 -0700)]
driver-core: platform: convert bus code to use dev_groups
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>
Greg Kroah-Hartman [Fri, 23 Aug 2013 21:24:41 +0000 (14:24 -0700)]
workqueue: convert bus code to use dev_groups
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>
Greg Kroah-Hartman [Fri, 23 Aug 2013 21:24:39 +0000 (14:24 -0700)]
MEI: convert bus code to use dev_groups
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>
Greg Kroah-Hartman [Fri, 23 Aug 2013 21:24:36 +0000 (14:24 -0700)]
USB: serial: convert bus code to use drv_groups
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>
Geert Uytterhoeven [Tue, 20 Aug 2013 19:38:03 +0000 (21:38 +0200)]
Kconfig: Remove hotplug enable hints in CONFIG_KEXEC help texts
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>
Greg Kroah-Hartman [Wed, 21 Aug 2013 22:45:05 +0000 (15:45 -0700)]
w1: slaves: w1_ds2781: convert to use w1_family_ops.groups
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>
Greg Kroah-Hartman [Wed, 21 Aug 2013 22:45:04 +0000 (15:45 -0700)]
w1: slaves: w1_ds2760: convert to use w1_family_ops.groups
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>
Greg Kroah-Hartman [Wed, 21 Aug 2013 22:45:03 +0000 (15:45 -0700)]
w1: slaves: w1_ds2780: convert to use w1_family_ops.groups
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>
Greg Kroah-Hartman [Wed, 21 Aug 2013 22:45:02 +0000 (15:45 -0700)]
w1: slaves: w1_ds28e04: convert to use w1_family_ops.groups
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>
Greg Kroah-Hartman [Wed, 21 Aug 2013 22:45:01 +0000 (15:45 -0700)]
w1: slaves: w1_ds2433: convert to use w1_family_ops.groups
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>
Greg Kroah-Hartman [Wed, 21 Aug 2013 22:45:00 +0000 (15:45 -0700)]
w1: slaves: w1_ds2431: convert to use w1_family_ops.groups
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>
Greg Kroah-Hartman [Wed, 21 Aug 2013 22:44:59 +0000 (15:44 -0700)]
w1: slaves: w1_ds2423: convert to use w1_family_ops.groups
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>
Greg Kroah-Hartman [Wed, 21 Aug 2013 22:44:58 +0000 (15:44 -0700)]
w1: slaves: w1_ds2413.c: convert to use w1_family_ops.groups
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>
Greg Kroah-Hartman [Wed, 21 Aug 2013 22:44:57 +0000 (15:44 -0700)]
w1: slaves: w1_ds2408: convert to use w1_family_ops.groups
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>
Greg Kroah-Hartman [Wed, 21 Aug 2013 22:44:56 +0000 (15:44 -0700)]
w1: slaves: w1_therm: convert to use w1_family_ops.groups
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>
Greg Kroah-Hartman [Wed, 21 Aug 2013 22:44:55 +0000 (15:44 -0700)]
w1: add attribute groups to struct w1_family_ops
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>
Greg Kroah-Hartman [Wed, 21 Aug 2013 20:24:33 +0000 (13:24 -0700)]
w1: use default attribute groups for w1 slave devices
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>
Greg Kroah-Hartman [Wed, 21 Aug 2013 20:24:32 +0000 (13:24 -0700)]
w1: remove race with sysfs file creation
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>
Greg Kroah-Hartman [Thu, 22 Aug 2013 17:25:34 +0000 (10:25 -0700)]
sysfs.h: remove attr_name() macro
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>
Greg Kroah-Hartman [Thu, 22 Aug 2013 16:23:28 +0000 (09:23 -0700)]
sysfs: group.c: fix up kerneldoc
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>
Greg Kroah-Hartman [Thu, 22 Aug 2013 15:34:39 +0000 (08:34 -0700)]
acpi: bgrt: fix build error due to attribute change
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>
Greg Kroah-Hartman [Thu, 22 Aug 2013 00:47:05 +0000 (17:47 -0700)]
sysfs: fix up minor coding style issues in sysfs.h
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>
Greg Kroah-Hartman [Wed, 21 Aug 2013 23:40:05 +0000 (16:40 -0700)]
sysfs: sysfs.h: fix coding style issues
This fixes up the remaining coding style issues in sysfs.h
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Greg Kroah-Hartman [Wed, 21 Aug 2013 23:37:42 +0000 (16:37 -0700)]
sysfs: file.c: fix up broken string warnings
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>
Greg Kroah-Hartman [Wed, 21 Aug 2013 23:36:02 +0000 (16:36 -0700)]
sysfs: dir.c: fix up odd do/while indentation
This fixes up the odd do/while after an if statement warning in dir.c
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Greg Kroah-Hartman [Wed, 21 Aug 2013 23:34:59 +0000 (16:34 -0700)]
sysfs: fix up uaccess.h coding style warnings
This fixes the uaccess.h warnings in the sysfs.c files.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Greg Kroah-Hartman [Wed, 21 Aug 2013 23:33:34 +0000 (16:33 -0700)]
sysfs: fix up 80 column coding style issues
This fixes up the 80 column coding style issues in the sysfs .c files.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Greg Kroah-Hartman [Wed, 21 Aug 2013 23:28:26 +0000 (16:28 -0700)]
sysfs: fix up space coding style issues
This fixes up all of the space-related coding style issues for the sysfs
code.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Greg Kroah-Hartman [Wed, 21 Aug 2013 23:21:17 +0000 (16:21 -0700)]
sysfs: remove trailing whitespace
This removes all trailing whitespace errors in the sysfs code.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Greg Kroah-Hartman [Wed, 21 Aug 2013 23:17:47 +0000 (16:17 -0700)]
sysfs: fix placement of EXPORT_SYMBOL()
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>
Greg Kroah-Hartman [Wed, 21 Aug 2013 23:14:11 +0000 (16:14 -0700)]
sysfs: group: update copyright to add myself and the LF
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Greg Kroah-Hartman [Wed, 21 Aug 2013 23:12:34 +0000 (16:12 -0700)]
sysfs: group.c: add kerneldoc for sysfs_remove_group
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>
Greg Kroah-Hartman [Wed, 21 Aug 2013 23:10:02 +0000 (16:10 -0700)]
sysfs: group.c: fix up broken string coding style
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>
Greg Kroah-Hartman [Wed, 21 Aug 2013 23:07:29 +0000 (16:07 -0700)]
sysfs: group.c: fix up some * coding style issues
This fixes up the * coding style warnings for the group.c sysfs file.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Greg Kroah-Hartman [Wed, 21 Aug 2013 23:06:14 +0000 (16:06 -0700)]
sysfs: group.c: fix trailing whitespace
There was some trailing spaces in the file, fix that up.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Greg Kroah-Hartman [Wed, 21 Aug 2013 23:04:12 +0000 (16:04 -0700)]
sysfs: group.c: move EXPORT_SYMBOL_GPL() to the proper location
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>
Greg Kroah-Hartman [Wed, 21 Aug 2013 20:47:50 +0000 (13:47 -0700)]
sysfs: add sysfs_create/remove_groups()
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>
Seth Jennings [Tue, 20 Aug 2013 21:05:05 +0000 (16:05 -0500)]
drivers: base: use standard device online/offline for state change
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>
Seth Jennings [Tue, 20 Aug 2013 17:13:03 +0000 (12:13 -0500)]
drivers: base: refactor add_memory_section() to add_memory_block()
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>
Seth Jennings [Tue, 20 Aug 2013 17:13:02 +0000 (12:13 -0500)]
drivers: base: remove improper get/put in add_memory_section()
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>
Seth Jennings [Tue, 20 Aug 2013 17:13:01 +0000 (12:13 -0500)]
drivers: base: reduce add_memory_section() for boot-time only
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>
Seth Jennings [Tue, 20 Aug 2013 17:13:00 +0000 (12:13 -0500)]
drivers: base: unshare add_memory_section() from hotplug
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>
Seth Jennings [Tue, 20 Aug 2013 17:12:59 +0000 (12:12 -0500)]
drivers: base: use device get/put functions
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>
Seth Jennings [Tue, 20 Aug 2013 17:12:58 +0000 (12:12 -0500)]
drivers: base: remove unneeded variable
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>
Seth Jennings [Tue, 20 Aug 2013 17:12:57 +0000 (12:12 -0500)]
drivers: base: move mutex lock out of add_memory_section()
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>
Greg KH [Wed, 21 Aug 2013 00:11:49 +0000 (17:11 -0700)]
ACPI: bgrt: take advantage of binary sysfs groups
Attribute groups now can handle binary sysfs attributes, so clean up the
code here by using a binary attribute array. This saves us the extra
call to create the binary attribute at saves 6 lines overall.
Cc: Len Brown <lenb@kernel.org>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
--
I can take this in my driver-core tree if someone from ACPI acks it,
otherwise, feel free to take it through the ACPI trees instead, just
let me know.
drivers/acpi/bgrt.c | 26 ++++++++++----------------
1 file changed, 10 insertions(+), 16 deletions(-)
Greg Kroah-Hartman [Wed, 24 Jul 2013 22:05:38 +0000 (15:05 -0700)]
hid: roccat-pyra: convert class code to use bin_attrs in groups
Now that attribute groups support binary attributes, use them instead of
the dev_bin_attrs field in struct class, as that is going away soon.
Cc: Jiri Kosina <jkosina@suse.cz>
Cc: Stefan Achatz <erazor_de@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Greg Kroah-Hartman [Tue, 20 Aug 2013 23:48:54 +0000 (16:48 -0700)]
sysfs.h: fix __BIN_ATTR_RW()
__BIN_ATTR_RW() wasn't passing in the _size field. As it would break
the build if this macro was ever used, it's obvious no one had ever
tried to use it before.
Fix it so that it can be used.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Greg Kroah-Hartman [Tue, 20 Aug 2013 04:56:46 +0000 (21:56 -0700)]
hid: roccat-kone: fix off-by-one bug in attributes
Stefan pointed out that I messed up the array for the binary attributes,
so fix it properly.
Reported-by: Stefan Achatz <erazor_de@users.sourceforge.net>
Cc: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Greg Kroah-Hartman [Tue, 20 Aug 2013 04:50:28 +0000 (21:50 -0700)]
hid: roccat-kovaplus: convert class code to use bin_attrs in groups
Now that attribute groups support binary attributes, use them instead of
the dev_bin_attrs field in struct class, as that is going away soon.
Cc: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Greg Kroah-Hartman [Tue, 20 Aug 2013 04:50:28 +0000 (21:50 -0700)]
hid: roccat-konepure: convert class code to use bin_attrs in groups
Now that attribute groups support binary attributes, use them instead of
the dev_bin_attrs field in struct class, as that is going away soon.
Cc: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Greg Kroah-Hartman [Tue, 20 Aug 2013 04:50:27 +0000 (21:50 -0700)]
hid: roccat-koneplus: convert class code to use bin_attrs in groups
Now that attribute groups support binary attributes, use them instead of
the dev_bin_attrs field in struct class, as that is going away soon.
Cc: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Greg Kroah-Hartman [Tue, 20 Aug 2013 04:40:27 +0000 (21:40 -0700)]
hid: roccat-savu: convert class code to use bin_attrs in groups
Now that attribute groups support binary attributes, use them instead of
the dev_bin_attrs field in struct class, as that is going away soon.
Cc: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Greg Kroah-Hartman [Tue, 20 Aug 2013 04:40:26 +0000 (21:40 -0700)]
hid: roccat-kone: convert class code to use bin_attrs in groups
Now that attribute groups support binary attributes, use them instead of
the dev_bin_attrs field in struct class, as that is going away soon.
Cc: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Greg Kroah-Hartman [Tue, 20 Aug 2013 04:40:26 +0000 (21:40 -0700)]
hid: roccat-isku: convert class code to use bin_attrs in groups
Now that attribute groups support binary attributes, use them instead of
the dev_bin_attrs field in struct class, as that is going away soon.
Cc: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Greg Kroah-Hartman [Tue, 20 Aug 2013 04:40:26 +0000 (21:40 -0700)]
hid: roccat-arvo: convert class code to use bin_attrs in groups
Now that attribute groups support binary attributes, use them instead of
the dev_bin_attrs field in struct class, as that is going away soon.
Cc: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Greg Kroah-Hartman [Wed, 24 Jul 2013 22:05:26 +0000 (15:05 -0700)]
backing-dev: convert class code to use dev_groups
The dev_attrs field of struct class is going away soon, dev_groups
should be used instead. This converts the backing device class code to
use the correct field.
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Jan Kara <jack@suse.cz>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Greg Kroah-Hartman [Wed, 24 Jul 2013 22:05:19 +0000 (15:05 -0700)]
PPS: convert class code to use dev_groups
The dev_attrs field of struct class is going away soon, dev_groups
should be used instead. This converts the pps class code to use the
correct field.
Cc: Rodolfo Giometti <giometti@enneenne.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Greg Kroah-Hartman [Wed, 24 Jul 2013 22:05:18 +0000 (15:05 -0700)]
x86: wmi: convert class code to use dev_groups
The dev_attrs field of struct class is going away soon, dev_groups
should be used instead. This converts the wmi class code to use the
correct field.
Cc: Matthew Garrett <matthew.garrett@nebula.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Greg Kroah-Hartman [Wed, 24 Jul 2013 22:05:14 +0000 (15:05 -0700)]
v4l2: convert class code to use dev_groups
The dev_attrs field of struct class is going away soon, dev_groups
should be used instead. This converts the v4l2 class code to use the
correct field.
Cc: Mauro Carvalho Chehab <mchehab@redhat.com>
Cc: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Greg Kroah-Hartman [Wed, 24 Jul 2013 22:05:11 +0000 (15:05 -0700)]
HID: roccat: convert class code to use dev_groups
The dev_attrs field of struct class is going away soon, dev_groups
should be used instead. This converts the roccat class code to use the
correct field.
Cc: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Greg Kroah-Hartman [Wed, 24 Jul 2013 22:05:09 +0000 (15:05 -0700)]
devfreq: convert devfreq_class to use dev_groups
The dev_attrs field of struct class is going away soon, dev_groups
should be used instead. This converts the devfreq_class code to use the
correct field.
Cc: MyungJoo Ham <myungjoo.ham@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Greg Kroah-Hartman [Wed, 24 Jul 2013 22:05:05 +0000 (15:05 -0700)]
mips: convert vpe_class to use dev_groups
The dev_attrs field of struct class is going away soon, dev_groups
should be used instead. This converts the MIPS vpe_class code to use
the correct field.
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: John Crispin <blogic@openwrt.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Hanjun Guo [Sat, 17 Aug 2013 12:42:26 +0000 (20:42 +0800)]
drivers / dma-contiguous: Fix __init attribute location
__init belongs after the return type on functions, not before it.
Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Hanjun Guo [Sat, 17 Aug 2013 12:42:25 +0000 (20:42 +0800)]
drivers / platform: Fix __init attribute location
__init belongs after the return type on functions, not before it.
Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Hanjun Guo [Sat, 17 Aug 2013 12:42:24 +0000 (20:42 +0800)]
drivers / base: Fix sysfs_deprecated_setup() __init attribute location
__init belongs after the return type on functions, not before it.
Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Rafael J. Wysocki [Tue, 13 Aug 2013 00:39:30 +0000 (02:39 +0200)]
driver core / cpu: Check if NUMA node is valid before bringing CPU up
There is a potential race condition between cpu_subsys_online()
and either acpi_processor_remove() or remove_memory() that execute
try_offline_node(). Namely, it is possible that cpu_subsys_online()
will run right after the CPUs NUMA node has been put offline and
cpu_to_node() executed by it will return NUMA_NO_NODE (-1). In
that case the CPU is gone and it doesn't make sense to call cpu_up()
for it, so make cpu_subsys_online() return -ENODEV then.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Toshi Kani <toshi.kani@hp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Lee, Jae-Hong [Mon, 12 Aug 2013 10:57:21 +0000 (19:57 +0900)]
Correct unfaithful translation on HOWTO in ko_KR
This patch corrects unfaithful Korean translation in Documentation/ko_KR/HOWTO.
Signed-off-by: Lee, Jae-Hong <pyrasis@gmail.com>
Acked-by: Minchan Kim <minchan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Lee, Jae-Hong [Mon, 12 Aug 2013 10:57:20 +0000 (19:57 +0900)]
Type fix on stable_api_nonsense.txt
This patch fixes some minor typos in Documentation/ko_KR/stable_api_nonsense.txt
Signed-off-by: Lee, Jae-Hong <pyrasis@gmail.com>
Acked-by: Minchan Kim <minchan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Lee, Jae-Hong [Mon, 12 Aug 2013 10:57:19 +0000 (19:57 +0900)]
Type fix on HOWTO in ko_KR
This patch fixes some minor typos in Documentation/ko_KR/HOWTO.
Signed-off-by: Lee, Jae-Hong <pyrasis@gmail.com>
Acked-by: Minchan Kim <minchan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Greg Kroah-Hartman [Thu, 8 Aug 2013 22:22:57 +0000 (15:22 -0700)]
driver core: bus_type: add bus_groups
attribute groups are much more flexible than just a list of attributes,
due to their support for visibility of the attributes, and binary
attributes. Add bus_groups to struct bus_type which should be used
instead of bus_attrs.
bus_attrs will be removed from the structure soon.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Greg Kroah-Hartman [Thu, 8 Aug 2013 22:22:56 +0000 (15:22 -0700)]
driver core: bus_type: add drv_groups
attribute groups are much more flexible than just a list of attributes,
due to their support for visibility of the attributes, and binary
attributes. Add drv_groups to struct bus_type which should be used
instead of drv_attrs.
drv_attrs will be removed from the structure soon.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Greg Kroah-Hartman [Thu, 8 Aug 2013 22:22:55 +0000 (15:22 -0700)]
driver core: bus_type: add dev_groups
attribute groups are much more flexible than just a list of attributes,
due to their support for visibility of the attributes, and binary
attributes. Add dev_groups to struct bus_type which should be used
instead of dev_attrs.
dev_attrs will be removed from the structure soon.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Hanjun Guo [Sat, 27 Jul 2013 03:00:51 +0000 (11:00 +0800)]
tile / cpu topology: remove stale Macro arch_provides_topology_pointers
Macro arch_provides_topology_pointers is pointless now, remove it.
Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
Cc: Chris Metcalf <cmetcalf@tilera.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Hanjun Guo [Sat, 27 Jul 2013 03:00:50 +0000 (11:00 +0800)]
x86 / cpu topology: remove the stale macro arch_provides_topology_pointers
Macro arch_provides_topology_pointers is pointless now, remove it.
Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Hanjun Guo [Sat, 27 Jul 2013 03:00:49 +0000 (11:00 +0800)]
cpu topology: remove stale arch_provides_topology_pointers and define_siblings_show_map/list()
arch_provides_topology_pointers was introduced in commit
23ca4bba3 (x86:
cleanup early per cpu variables/accesses v4) to indicate pointers to the
topology cpumask_t maps are valid to avoid copying data on to/off of the
stack.
But later in commit
fbd59a8d (cpumask: Use topology_core_cpumask()/
topology_thread_cpumask()), the pointers to the topology struct cpumask maps
are always valid.
After that commit, the only difference is that there is a redundant
"unsigned int cpu = dev->id;" if arch_provides_topology_pointers defined, but
dev->id is type 'u32' which devolves to 'unsigned int' on all supported arches.
So this arch_provides_topology_pointers define is pointless and only cause
obfuscation now, remove it.
Tested on x86 machine, topology information in sys/devices/system/cpu/
cpuX/topology/ is the same after appling this patch set.
Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Greg Kroah-Hartman [Wed, 24 Jul 2013 22:05:22 +0000 (15:05 -0700)]
rtc: convert class code to use dev_groups
The dev_attrs field of struct class is going away soon, dev_groups
should be used instead. This converts the rtc class code to use the
correct field.
Acked-by: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Greg Kroah-Hartman [Mon, 29 Jul 2013 19:30:13 +0000 (12:30 -0700)]
Merge 3.11-rc3 into driver-core-next
We want these fixes in this branch.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Linus Torvalds [Mon, 29 Jul 2013 03:53:33 +0000 (20:53 -0700)]
Linux 3.11-rc3
Linus Torvalds [Mon, 29 Jul 2013 01:19:27 +0000 (18:19 -0700)]
Merge tag 'pinctrl-for-v3.11-2' of git://git./linux/kernel/git/linusw/linux-pinctrl
Pull pin control fixes from Linus Walleij:
- Driver fixes for AM33xx, SIRF and PFC pin controllers
- Fix a compile warning from the pinctrl single-register driver
- Fix a little nasty memory leak
* tag 'pinctrl-for-v3.11-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
pinctrl: fix a memleak when freeing maps
pinctrl: pinctrl-single: fix compile warning when no CONFIG_PM
pinctrl: sh-pfc: fix SDHI0 VccQ regulator on sh73a0 with DT
arm/dts: sirf: fix the pingroup name mismatch between drivers and dts
pinctrl: sirf: add usp0_uart_nostreamctrl pin group for usp-uart without flowctrl
pinctrl: sirf: fix the pin number and mux bit for usp0
pinctrl: am33xx dt binding: correct include path
Linus Torvalds [Mon, 29 Jul 2013 01:10:39 +0000 (18:10 -0700)]
Merge tag 'trace-fixes-3.11-rc2' of git://git./linux/kernel/git/rostedt/linux-trace
Pull tracing fixes from Steven Rostedt:
"Oleg is working on fixing a very tight race between opening a event
file and deleting that event at the same time (both must be done as
root).
I also found a bug while testing Oleg's patches which has to do with a
race with kprobes using the function tracer.
There's also a deadlock fix that was introduced with the previous
fixes"
* tag 'trace-fixes-3.11-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
tracing: Remove locking trace_types_lock from tracing_reset_all_online_cpus()
ftrace: Add check for NULL regs if ops has SAVE_REGS set
tracing: Kill trace_cpu struct/members
tracing: Change tracing_fops/snapshot_fops to rely on tracing_get_cpu()
tracing: Change tracing_entries_fops to rely on tracing_get_cpu()
tracing: Change tracing_stats_fops to rely on tracing_get_cpu()
tracing: Change tracing_buffers_fops to rely on tracing_get_cpu()
tracing: Change tracing_pipe_fops() to rely on tracing_get_cpu()
tracing: Introduce trace_create_cpu_file() and tracing_get_cpu()
Linus Torvalds [Mon, 29 Jul 2013 01:09:34 +0000 (18:09 -0700)]
Merge tag 'scsi-fixes' of git://git./linux/kernel/git/jejb/scsi
Pull SCSI fixes from James Bottomley:
"This is five bug fixes, two of which fix long standing problems
causing crashes (sd and mvsas). The remaining three are hung (isci
race) or lost (qla2xxx, isci) devices"
* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
[SCSI] isci: fix breakage caused by >16byte CDB patch
[SCSI] mvsas: Fix kernel panic on tile due to unaligned data access
[SCSI] sd: fix crash when UA received on DIF enabled device
[SCSI] qla2xxx: Properly set the tagging for commands.
[SCSI] isci: Fix a race condition in the SSP task management path
Greg Kroah-Hartman [Wed, 24 Jul 2013 22:05:34 +0000 (15:05 -0700)]
net: ieee802154: convert class code to use dev_groups
The dev_attrs field of struct class is going away soon, dev_groups
should be used instead. This converts the ieee802154 class code to use
the correct field.
Acked-by: David S. Miller <davem@davemloft.net>
Cc: Alexander Smirnov <alex.bluesman.smirnov@gmail.com>
Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Greg Kroah-Hartman [Wed, 24 Jul 2013 22:05:33 +0000 (15:05 -0700)]
net: core: convert class code to use dev_groups
The dev_attrs field of struct class is going away soon, dev_groups
should be used instead. This converts the networking core class code to
use the correct field.
In order to do this in the "cleanest" way, some of the macros had to be
changed to reflect the driver core format of naming show/store
functions, which accounts for the majority of the churn in this file.
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Greg Kroah-Hartman [Wed, 24 Jul 2013 22:05:24 +0000 (15:05 -0700)]
cuse: convert class code to use dev_groups
The dev_attrs field of struct class is going away soon, dev_groups
should be used instead. This converts the cuse class code to use the
correct field.
Acked-by: Miklos Szeredi <mszeredi@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>