aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorPhil Carmody <ext-phil.2.carmody@nokia.com>2009-12-18 08:34:19 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2009-12-23 14:23:43 -0500
commit26579ab70aa0e0ea434e6e100279d2f67c094431 (patch)
tree1c9dfd6ed6209ecee088e3e6b600ebd7fba24acc /drivers
parent8e9b9362266dd16255473c080d846b13e27247bf (diff)
Driver core: device_attribute parameters can often be const*
Most device_attributes are const, and are begging to be put in a ro section. However, the create and remove file interfaces were failing to propagate the const promise which the only functions they call offer. Signed-off-by: Phil Carmody <ext-phil.2.carmody@nokia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/base/core.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/base/core.c b/drivers/base/core.c
index f1290cbd1350..2fd9e611f8a6 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -446,7 +446,8 @@ struct kset *devices_kset;
446 * @dev: device. 446 * @dev: device.
447 * @attr: device attribute descriptor. 447 * @attr: device attribute descriptor.
448 */ 448 */
449int device_create_file(struct device *dev, struct device_attribute *attr) 449int device_create_file(struct device *dev,
450 const struct device_attribute *attr)
450{ 451{
451 int error = 0; 452 int error = 0;
452 if (dev) 453 if (dev)
@@ -459,7 +460,8 @@ int device_create_file(struct device *dev, struct device_attribute *attr)
459 * @dev: device. 460 * @dev: device.
460 * @attr: device attribute descriptor. 461 * @attr: device attribute descriptor.
461 */ 462 */
462void device_remove_file(struct device *dev, struct device_attribute *attr) 463void device_remove_file(struct device *dev,
464 const struct device_attribute *attr)
463{ 465{
464 if (dev) 466 if (dev)
465 sysfs_remove_file(&dev->kobj, &attr->attr); 467 sysfs_remove_file(&dev->kobj, &attr->attr);