]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commit
PCI: Make settable sysfs attributes more consistent
authorTrent Piepho <xyzzy@speakeasy.org>
Mon, 1 Dec 2008 01:10:12 +0000 (17:10 -0800)
committerJesse Barnes <jbarnes@virtuousgeek.org>
Wed, 7 Jan 2009 19:12:58 +0000 (11:12 -0800)
commit92425a405ea482209b43093a5e35be7de02acf18
tree0cf7d494d8a743350f29a827a272287a7d99b5d1
parent1684f5ddd4c0c754f52c78eaa2c5c69ad09fb18c
PCI: Make settable sysfs attributes more consistent

PCI devices have three settable boolean attributes, enable,
broken_parity_status, and msi_bus.

The store functions for these would silently interpret "0x01" as false,
"1llogical" as true, and "true" would be (silently!) ignored and do
nothing.

This is inconsistent with typical sysfs handling of settable attributes,
and just plain doesn't make much sense.

So, use strict_strtoul(), which was created for this purpose.  The store
functions will treat a value of 0 as false, non-zero as true, and return
-EINVAL for a parse failure.

Additionally, is_enabled_store() and msi_bus_store() return -EPERM if
CAP_SYS_ADMIN is lacking, rather than silently doing nothing.  This is more
typical behavior for sysfs attributes that need a capability.

And msi_bus_store() will only print the "forced subordinate bus ..."
warning if the MSI flag was actually forced to a different value.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
drivers/pci/pci-sysfs.c