aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2010-03-07driver core: Use sysfs_rename_link in device_renameEric W. Biederman1-12/+6
Don't open code the renaming of symlinks in sysfs instead use the new helper function sysfs_rename_link Acked-by: Tejun Heo <[email protected]> Acked-by: Serge Hallyn <[email protected]> Signed-off-by: Eric W. Biederman <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-07sysfs: Implement sysfs_rename_linkEric W. Biederman2-0/+47
Because of rename ordering problems we occassionally give false warnings about invalid sysfs operations. So using sysfs_rename create a sysfs_rename_link function that doesn't need strange workarounds. Cc: Benjamin Thery <[email protected]> Cc: Daniel Lezcano <[email protected]> Acked-by: Serge Hallyn <[email protected]> Acked-by: Tejun Heo <[email protected]> Signed-off-by: Eric W. Biederman <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-07sysfs: Pack sysfs_dirent more tightly.Eric W. Biederman1-1/+1
Placing the 16bit s_mode between a pointer and a long doesn't pack well especailly on 64bit where we wast 48 bits. So move s_mode and declare it as a unsigned short. This is the sysfs backing store after all we don't need fields extra large just in case someday we want userspace to be able to use a larger value. Acked-by: Tejun Heo <[email protected]> Signed-off-by: Eric W. Biederman <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-07sysfs: Serialize updates to the vfs inodeEric W. Biederman1-4/+4
The vfs depends upon filesystem methods to update the vfs inode. Sysfs adds to the normal number of places where the vfs inode is updated by also updatng the vfs inode in sysfs_refresh_inode. Typically the inode mutex is used to serialize updates to the vfs inode, but grabbing the inode mutex in sysfs_permission and sysfs_getattr causes deadlocks, because sometimes the vfs calls those operations with the inode mutex held. Therefore sysfs can not use the inode mutex to serial updates to the vfs inode. The sysfs_mutex is acquired in all of the routines where sysfs updates the vfs inode, and with a small change we can consistently protext sysfs vfs inode updates with the sysfs_mutex. To protect the sysfs vfs inode updates with the sysfs_mutex simply requires extending the scope of sysfs_mutex in sysfs_setattr over inode_setattr, and over inode_change_ok (so we have an unchanging inode when we perform the check). Acked-by: Serge Hallyn <[email protected]> Signed-off-by: Eric W. Biederman <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-07sysfs: windfarm: init sysfs attributesJohannes Berg2-0/+2
This is required for lockdep. Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-07sysfs: Use sysfs_attr_init and sysfs_bin_attr_init on module dynamic attributesEric W. Biederman1-0/+3
A little more whack-a-mole annotating the dynamic sysfs attributes. I had everything built into my earlier test kernel, and so I missed these. Signed-off-by: Eric W. Biederman <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-07sysfs: Document sysfs_attr_init and sysfs_bin_attr_initEric W. Biederman1-0/+20
I have added a new requirement to the external sysfs interface that dynamically allocated sysfs attributes must call sysfs_attr_init if lockdep is enabled. For the time being callying sysfs_attr_init is only mandatory if lockdep is enabled, so we can live with a few unconverted instances until we find them all. As this is part of the public interface of sysfs it is a good idea to document these pseudo functions so someone inspeciting the code can find out what has happened. Signed-off-by: Eric W. Biederman <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-07sysfs: Use sysfs_attr_init and sysfs_bin_attr_init on dynamic attributesEric W. Biederman4-0/+9
These are the non-static sysfs attributes that exist on my test machine. Fix them to use sysfs_attr_init or sysfs_bin_attr_init as appropriate. It simply requires making a sysfs attribute present to see this. So this is a little bit tedious but otherwise not too bad. Signed-off-by: Eric W. Biederman <[email protected]> Acked-by: WANG Cong <[email protected]> Cc: Tejun Heo <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-07sysfs: Use one lockdep class per sysfs attribute.Eric W. Biederman2-2/+23
Acknowledge that the logical sysfs rwsem has one instance per sysfs attribute with different locking depencencies for different attributes. There is a sysfs idiom where writing to one sysfs file causes the addition or removal of other sysfs files. Lumping all of the sysfs attributes together in one lock class causes lockdep to generate lots of false positives. This introduces the requirement that non-static sysfs attributes need to be initialized with sysfs_attr_init or sysfs_bin_attr_init. Strictly speaking this requirement only exists when lockdep is enabled, and when lockdep is enabled we get a bit fat warning if this requirement is not met. Signed-off-by: Eric W. Biederman <[email protected]> Acked-by: WANG Cong <[email protected]> Cc: Tejun Heo <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-07sysfs: Only take active references on attributes.Eric W. Biederman3-1/+6
If we exclude directories and symlinks from the set of sysfs dirents where we need active references we are left with sysfs attributes (binary or not). - Tweak sysfs_deactivate to only do something on attributes - Move lockdep initialization into sysfs_file_add_mode to limit it to just attributes. Signed-off-by: Eric W. Biederman <[email protected]> Acked-by: WANG Cong <[email protected]> Cc: Tejun Heo <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-07sysfs: Remove sysfs_get/put_active_twoEric W. Biederman4-77/+38
It turns out that holding an active reference on a directory is pointless. The purpose of the active references are to allows us to block when removing sysfs entries that have custom methods so we don't remove modules while running modular code and to keep those custom methods from accessing data structures after the files have been removed. Further sysfs_remove_dir remove all elements in the directory before removing the directory itself, so there is no chance we will remove a directory with active children. Signed-off-by: Eric W. Biederman <[email protected]> Cc: Tejun Heo <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-07Driver core: Fix first line of kernel-doc for a few functionsBen Hutchings2-9/+9
The function name must be followed by a space, hypen, space, and a short description. Signed-off-by: Ben Hutchings <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-07UIO: Remove SMX Cryptengine driverHans J. Koch3-152/+0
Ben Nizette, the author of this driver, told me in a private mail that this project has been cancelled. He suggested to remove the driver for now, and will come back with a new version should the hardware really exist. This patch completely removes the driver. Signed-off-by: Hans J. Koch <[email protected]> Acked-by: Ben Nizette <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-07UIO: minor Kconfig fixesJohn Ogness1-1/+1
Two trivial fixes for the Userspace IO Kconfig file: 1) uio_sercos3 is a PCI driver, so let it depend on PCI. 2) "default n" under UIO_PCI_GENERIC is luxury since it is already the default. Acked-by: John Ogness <[email protected]> Signed-off-by: Hans J. Koch <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-07UIO: Add a driver for Hilscher netX-based fieldbus cardsHans J. Koch3-0/+184
This patch adds a Userspace IO driver for netX-based fieldbus cards by Hilscher (see http://www.hilscher.com). ATM, cifX and comX cards are supported. The userspace part for this driver is provided by Hilscher and should come with the card. The driver is in use for several months now and has been tested by people at Hilscher and Linutronix. Signed-off-by: Hans J. Koch <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-07auxdisplay: move cfag12864bfb's probe function to .devinit.textUwe Kleine-König1-1/+1
A pointer to cfag12864bfb_probe is passed to the core via platform_driver_register and so the function must not disappear when the .init sections are discarded. Otherwise (if also having HOTPLUG=y) unbinding and binding a device to the driver via sysfs will result in an oops as does a device being registered late. An alternative to this patch is using platform_driver_probe instead of platform_driver_register plus removing the pointer to the probe function from the struct platform_driver. Signed-off-by: Uwe Kleine-König <[email protected]> Acked-by: Miguel Ojeda <[email protected]> Cc: Andrew Morton <[email protected]> Cc: Avuton Olrich <[email protected]> Cc: Antonino Daplas <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-07media: move omap24xxcam's probe function to .devinit.textUwe Kleine-König1-1/+1
A pointer to omap24xxcam_probe is passed to the core via platform_driver_register and so the function must not disappear when the .init sections are discarded. Otherwise (if also having HOTPLUG=y) unbinding and binding a device to the driver via sysfs will result in an oops as does a device being registered late. An alternative to this patch is using platform_driver_probe instead of platform_driver_register plus removing the pointer to the probe function from the struct platform_driver. Signed-off-by: Uwe Kleine-König <[email protected]> Acked-by: Sakari Ailus <[email protected]> Acked-by: Trilok Soni <[email protected]> Cc: Hans Verkuil <[email protected]> Cc: Mauro Carvalho Chehab <[email protected]> Cc: Andrew Morton <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-07w1: move omap_hdq's probe function to .devinit.textUwe Kleine-König1-2/+2
A pointer to omap_hdq_probe is passed to the core via platform_driver_register and so the function must not disappear when the .init sections are discarded. Otherwise (if also having HOTPLUG=y) unbinding and binding a device to the driver via sysfs will result in an oops as does a device being registered late. An alternative to this patch is using platform_driver_probe instead of platform_driver_register plus removing the pointer to the probe function from the struct platform_driver. Signed-off-by: Uwe Kleine-König <[email protected]> Cc: Stanley.Miao <[email protected]> Acked-by: Evgeniy Polyakov <[email protected]> Cc: Andrew Morton <[email protected]> Cc: Madhusudhan Chikkature <[email protected]> Cc: Felipe Balbi <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-07i2c: move i2c_omap's probe function to .devinit.textUwe Kleine-König1-1/+1
A pointer to omap_i2c_probe is passed to the core via platform_driver_register and so the function must not disappear when the .init sections are discarded. Otherwise (if also having HOTPLUG=y) unbinding and binding a device to the driver via sysfs will result in an oops as does a device being registered late. An alternative to this patch is using platform_driver_probe instead of platform_driver_register plus removing the pointer to the probe function from the struct platform_driver. Signed-off-by: Uwe Kleine-König <[email protected]> Cc: Kalle Jokiniemi <[email protected]> Cc: Tony Lindgren <[email protected]> Cc: Paul Walmsley <[email protected]> Cc: Richard Woodruff <[email protected]> Cc: chandra shekhar <[email protected]> Cc: Jason P Marini <[email protected]> Cc: Syed Mohammed Khasim <[email protected]> Cc: Jarkko Nikula <[email protected]> Cc: Juha Yrjola <[email protected]> Cc: Andrew Morton <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-07x86: move hp-wmi's probe function to .devinit.textUwe Kleine-König1-2/+2
A pointer to hp_wmi_bios_setup is passed to the core via platform_driver_register and so the function must not disappear when the .init sections are discarded. Otherwise (if also having HOTPLUG=y) unbinding and binding a device to the driver via sysfs will result in an oops as does a device being registered late. An alternative to this patch is using platform_driver_probe instead of platform_driver_register plus removing the pointer to the probe function from the struct platform_driver. Signed-off-by: Uwe Kleine-König <[email protected]> Cc: Frans Pop <[email protected]> Cc: Larry Finger <[email protected]> Cc: Len Brown <[email protected]> Cc: Helge Deller <[email protected]> Cc: Andrew Morton <[email protected]> Acked-by: Matthew Garrett <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-07platform-drivers: move probe to .devinit.text in drivers/videoUwe Kleine-König17-18/+18
A pointer to a probe callback is passed to the core via platform_driver_register and so the function must not disappear when the .init sections are discarded. Otherwise (if also having HOTPLUG=y) unbinding and binding a device to the driver via sysfs will result in an oops as does a device being registered late. An alternative to this patch is using platform_driver_probe instead of platform_driver_register plus removing the pointer to the probe function from the struct platform_driver. Signed-off-by: Uwe Kleine-König <[email protected]> Cc: Adrian Bunk <[email protected]> Cc: Alberto Mardegan <[email protected]> Cc: Andrew Morton <[email protected]> Cc: Andriy Skulysh <[email protected]> Cc: Antonino Daplas <[email protected]> Cc: Anton Vorontsov <[email protected]> Cc: Ben Dooks <[email protected]> Cc: Chandramouli Narayanan <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: Frans Pop <[email protected]> Cc: Geert Uytterhoeven <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Helge Deller <[email protected]> Cc: Huang Ying <[email protected]> Cc: Ian Molton <[email protected]> Cc: Joshua Kinard <[email protected]> Cc: Kaj-Michael Lang <[email protected]> Cc: Krzysztof Helt <[email protected]> Cc: [email protected] Cc: Maciej W. Rozycki <[email protected]> Cc: Magnus Damm <[email protected]> Cc: Martin Michlmayr <[email protected]> Cc: Matthias Kaehlcke <[email protected]> Cc: Paul Mundt <[email protected]> Cc: Pavel Machek <[email protected]> Cc: Philipp Zabel <[email protected]> Cc: Richard Purdie <[email protected]> Cc: Roel Kluin <[email protected]> Cc: Roland Stigge <[email protected]> Cc: Russell King <[email protected]> Cc: Thomas Bogendoerfer <[email protected]> Cc: Vincent Sanders <[email protected]> Cc: Yoichi Yuasa <[email protected]> Acked-by: Ralf Baechle <[email protected]> Acked-by: Arnaud Patard <[email protected]> Acked-by: James Simmons <[email protected]> Acked-by: Peter Jones <[email protected]> Acked-by: Jaya Kumar <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-07platform-drivers: move probe to .devinit.text in drivers/scsiUwe Kleine-König2-2/+2
A pointer to a probe callback is passed to the core via platform_driver_register and so the function must not disappear when the .init sections are discarded. Otherwise (if also having HOTPLUG=y) unbinding and binding a device to the driver via sysfs will result in an oops as does a device being registered late. An alternative to this patch is using platform_driver_probe instead of platform_driver_register plus removing the pointer to the probe function from the struct platform_driver. Signed-off-by: Uwe Kleine-König <[email protected]> Cc: Andrew Morton <[email protected]> Cc: David Brownell <[email protected]> Cc: Dmitri Vorobiev <[email protected]> Cc: Henrik Kretzschmar <[email protected]> Cc: James Bottomley <[email protected]> Cc: Kay Sievers <[email protected]> Cc: peter fuerst <[email protected]> Cc: Thomas Bogendoerfer <[email protected]> Acked-by: Ralf Baechle <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-07platform-drivers: move probe to .devinit.text in arch/armUwe Kleine-König4-4/+4
A pointer to a probe callback is passed to the core via platform_driver_register and so the function must not disappear when the .init sections are discarded. Otherwise (if also having HOTPLUG=y) unbinding and binding a device to the driver via sysfs will result in an oops as does a device being registered late. An alternative to this patch is using platform_driver_probe instead of platform_driver_register plus removing the pointer to the probe function from the struct platform_driver. Signed-off-by: Uwe Kleine-König <[email protected]> Cc: Andrew Morton <[email protected]> Cc: Ben Dooks <[email protected]> Cc: Dmitry Baryshkov <[email protected]> Cc: Eric Miao <[email protected]> Cc: Liam Girdwood <[email protected]> Cc: Paul Sokolovsky <[email protected]> Cc: Richard Purdie <[email protected]> Cc: Russell King <[email protected]> Acked-by: Arnaud Patard <[email protected]> Acked-by: Dmitry Eremin-Solenikov <[email protected]> Acked-by: Kristoffer Ericson <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-07Driver core: make struct platform_driver.id_table constUwe Kleine-König2-2/+2
This fixes a warning on several pxa based machines: arch/arm/mach-pxa/ssp.c:475: warning: initialization discards qualifiers from pointer target type Signed-off-by: Uwe Kleine-König <[email protected]> Acked-by: Vikram Dhillon <[email protected]> Acked-by: Eric Miao <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-07Driver core: Constify struct sysfs_ops in struct kobj_typeEmese Revfy54-70/+69
Constify struct sysfs_ops. This is part of the ops structure constification effort started by Arjan van de Ven et al. Benefits of this constification: * prevents modification of data that is shared (referenced) by many other structure instances at runtime * detects/prevents accidental (but not intentional) modification attempts on archs that enforce read-only kernel data at runtime * potentially better optimized code as the compiler can assume that the const data cannot be changed * the compiler/linker move const data into .rodata and therefore exclude them from false sharing Signed-off-by: Emese Revfy <[email protected]> Acked-by: David Teigland <[email protected]> Acked-by: Matt Domsch <[email protected]> Acked-by: Maciej Sosnowski <[email protected]> Acked-by: Hans J. Koch <[email protected]> Acked-by: Pekka Enberg <[email protected]> Acked-by: Jens Axboe <[email protected]> Acked-by: Stephen Hemminger <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-07sysdev: fix up the probe/release attributesGreg Kroah-Hartman1-8/+8
These should be sysdev attributes, not class attributes. This patch should resolve the problem. Thanks to Stephen Rothwell for pointing out the problem. Reported-by: Stephen Rothwell <[email protected]> Cc: Andi Kleen <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-07HOWTO: Updates on subsystem trees, patchwork, -next (vs. -mm)Stefan Richter1-77/+36
One of the roles which -mm fulfilled some time ago (to offer an integration testing ground) has been taken over by -next. This is still news to Documentation/HOWTO, so mention it there. Also add a word on how patchwork is used to track patches as they make their way into subsystem trees. Remove some arbitrary links to subsystem repositories; they can all be found in the MAINTAINERS database. Acked-by: Randy Dunlap <[email protected]> Signed-off-by: Stefan Richter <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-07kobject: Constify struct kset_uevent_opsEmese Revfy9-14/+14
Constify struct kset_uevent_ops. This is part of the ops structure constification effort started by Arjan van de Ven et al. Benefits of this constification: * prevents modification of data that is shared (referenced) by many other structure instances at runtime * detects/prevents accidental (but not intentional) modification attempts on archs that enforce read-only kernel data at runtime * potentially better optimized code as the compiler can assume that the const data cannot be changed * the compiler/linker move const data into .rodata and therefore exclude them from false sharing Signed-off-by: Emese Revfy <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-07driver-core: firmware_class: remove base.h header inclusionLuis R. Rodriguez1-1/+0
base.h is used by base drivers for sharing internal structures. Turns out firmware_class does not depend on it at all so remove it. Cc: Johannes Berg <[email protected]> Signed-off-by: Luis R. Rodriguez <[email protected]> Acked-by: Marcel Holtmann <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-07sysfs: Cache the last sysfs_dirent to improve readdir scalability v2Eric W. Biederman1-22/+60
When sysfs_readdir stops short we now cache the next sysfs_dirent to return to user space in filp->private_data. There is no impact on the rest of sysfs by doing this and in the common case it allows us to pick up exactly where we left off with no seeking. Additionally I drop and regrab the sysfs_mutex around filldir to avoid a page fault abritrarily increasing the hold time on the sysfs_mutex. v2: Returned to using INT_MAX as the EOF condition. seekdir is ambiguous unless all directory entries have a unique f_pos value. Fixes http://bugzilla.kernel.org/show_bug.cgi?id=14949 Signed-off-by: Eric W. Biederman <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-07Driver-Core: require valid action string in uevent triggerKay Sievers1-8/+3
No longer fall back to "add" and warn, but always require a valid action-string written to the "uevent" file. Signed-off-by: Kay Sievers <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-07Driver-Core: disable /sbin/hotplug by defaultKay Sievers1-1/+9
No recent mainstream system uses the /sbin/hotplug fork-bomb any more. Disable it by default to reflect how it is used these days. Signed-off-by: Kay Sievers <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-07Driver-Core: devtmpfs - remove EXPERIMENTAL and flush out the descriptionKay Sievers1-17/+24
All major distros enable devtmpfs on recent systems, so remove the EXPERIMENTAL flag, and make the description a bit more instructive. Signed-off-by: Kay Sievers <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-07Driver-Core: devtmpfs - reset inode permissions before unlinkingKay Sievers1-0/+13
Before unlinking the inode, reset the current permissions of possible references like hardlinks, so granted permissions can not be retained across the device lifetime by creating hardlinks, in the unusual case that there is a user-writable directory on the same filesystem. Signed-off-by: Kay Sievers <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-07driver core: Convert some drivers to CLASS_ATTR_STRINGAndi Kleen6-57/+27
Convert some drivers who export a single string as class attribute to the new class_attr_string functions. This removes redundant code all over. Signed-off-by: Andi Kleen <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-07driver core: Add class_attr_string for simple read-only stringAndi Kleen2-0/+27
Several drivers just export a static string as class attributes. Use the new extensible attribute support to define a simple CLASS_ATTR_STRING() macro for this. This will allow to remove code from drivers in followon patches. Signed-off-by: Andi Kleen <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-07driver-core: Add attribute argument to class_attribute show/storeAndi Kleen21-32/+87
Passing the attribute to the low level IO functions allows all kinds of cleanups, by sharing low level IO code without requiring an own function for every piece of data. Also drivers can extend the attributes with own data fields and use that in the low level function. This makes the class attributes the same as sysdev_class attributes and plain attributes. This will allow further cleanups in drivers. Full tree sweep converting all users. Signed-off-by: Andi Kleen <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-07sysdev: fix missing s390 conversionHeiko Carstens1-1/+3
In linux-next "sysdev: Pass attribute in sysdev_class attributes show/store" forgot to convert one place in s390 code. Here is the missing part. Cc: Andi Kleen <[email protected]> Cc: Martin Schwidefsky <[email protected]> Signed-off-by: Heiko Carstens <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-07sysdev: Fix type of sysdev class attribute in memory driverAndi Kleen1-3/+4
This attribute is really a sysdev_class attribute, not a plain class attribute. They are identical in layout currently, but this might not always be the case. Signed-off-by: Andi Kleen <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-07sysdev: Add sysdev_create/remove_filesAndi Kleen1-0/+13
Allow to create/remove arrays of sysdev attributes Just wrappers around sysfs_create/move_files Will be used later to clean up some drivers. Signed-off-by: Andi Kleen <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-07sysdev: Use sysdev_class attribute arrays in node driverAndi Kleen1-15/+16
Convert the node driver to sysdev_class attribute arrays. This greatly cleans up the code and remove a lot of code. Saves ~150 bytes of code on x86-64. Signed-off-by: Andi Kleen <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-07sysdev: Convert node driverAndi Kleen1-40/+17
Use sysdev_class attribute arrays in node driver Convert the node driver to sysdev_class attribute arrays. This greatly cleans up the code and remove a lot of code. Signed-off-by: Andi Kleen <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-07sysfs: Add attribute array to sysdev classesAndi Kleen2-1/+10
Add a attribute array that is automatically registered and unregistered to struct sysdev_class. This is similar to what struct class has. A lot of drivers add list of attributes, so it's better to do this easily in the common sysdev layer. This adds a new field to struct sysdev_class. I audited the whole tree and there are no dynamically allocated sysdev classes, so this is fully compatible. Signed-off-by: Andi Kleen <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-07sysfs: Add sysfs_add/remove_files utility functionsAndi Kleen2-0/+34
Adding/Removing a whole array of attributes is very common. Add a standard utility function to do this with a simple function call, instead of requiring drivers to open code this. Signed-off-by: Andi Kleen <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-07sysdev: Convert cpu driver sysdev class attributesAndi Kleen1-16/+21
Using the new attribute argument convert the cpu driver class attributes to carry the node state. Then use a shared function to do what a lot of individual functions did before. This eliminates an ugly macro. Signed-off-by: Andi Kleen <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-07sysdev: Convert node driver class attributes to be data drivenAndi Kleen1-47/+18
Using the new attribute argument convert the node driver class attributes to carry the node state. Then use a shared function to do what a lot of individual functions did before. Signed-off-by: Andi Kleen <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-07sysdev: Pass attribute in sysdev_class attributes show/storeAndi Kleen10-30/+89
Passing the attribute to the low level IO functions allows all kinds of cleanups, by sharing low level IO code without requiring an own function for every piece of data. Also drivers can extend the attributes with own data fields and use that in the low level function. Similar to sysdev_attributes and normal attributes. This is a tree-wide sweep, converting everything in one go. No functional changes in this patch other than passing the new argument everywhere. Tested on x86, the non x86 parts are uncompiled. Signed-off-by: Andi Kleen <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-07driver core: make platform_device_id table constEric Miao1-1/+1
The platform ID table is normally const, force that by adding the attribute. Signed-off-by: Eric Miao <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-07Driver core: add platform_create_bundle() helperDmitry Torokhov2-0/+63
Many legacy-style module create singleton platform devices themselves, along with corresponding platform driver. Instead of replicating error handling code in all such drivers, provide a helper that allocates and registers a single platform device and a driver and binds them together. Signed-off-by: Dmitry Torokhov <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-07kset-example: Spelling fixes.Radu Voicilas1-2/+2
No change in functionality. Signed-off-by: Radu Voicilas <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>