diff options
| -rw-r--r-- | Documentation/filesystems/sysfs.txt | 8 | ||||
| -rw-r--r-- | drivers/base/core.c | 6 | ||||
| -rw-r--r-- | include/linux/device.h | 4 |
3 files changed, 10 insertions, 8 deletions
diff --git a/Documentation/filesystems/sysfs.txt b/Documentation/filesystems/sysfs.txt index b245d524d568..a4ac2b98c613 100644 --- a/Documentation/filesystems/sysfs.txt +++ b/Documentation/filesystems/sysfs.txt | |||
| @@ -91,8 +91,8 @@ struct device_attribute { | |||
| 91 | const char *buf, size_t count); | 91 | const char *buf, size_t count); |
| 92 | }; | 92 | }; |
| 93 | 93 | ||
| 94 | int device_create_file(struct device *, struct device_attribute *); | 94 | int device_create_file(struct device *, const struct device_attribute *); |
| 95 | void device_remove_file(struct device *, struct device_attribute *); | 95 | void device_remove_file(struct device *, const struct device_attribute *); |
| 96 | 96 | ||
| 97 | It also defines this helper for defining device attributes: | 97 | It also defines this helper for defining device attributes: |
| 98 | 98 | ||
| @@ -316,8 +316,8 @@ DEVICE_ATTR(_name, _mode, _show, _store); | |||
| 316 | 316 | ||
| 317 | Creation/Removal: | 317 | Creation/Removal: |
| 318 | 318 | ||
| 319 | int device_create_file(struct device *device, struct device_attribute * attr); | 319 | int device_create_file(struct device *dev, const struct device_attribute * attr); |
| 320 | void device_remove_file(struct device * dev, struct device_attribute * attr); | 320 | void device_remove_file(struct device *dev, const struct device_attribute * attr); |
| 321 | 321 | ||
| 322 | 322 | ||
| 323 | - bus drivers (include/linux/device.h) | 323 | - bus drivers (include/linux/device.h) |
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 | */ |
| 449 | int device_create_file(struct device *dev, struct device_attribute *attr) | 449 | int 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 | */ |
| 462 | void device_remove_file(struct device *dev, struct device_attribute *attr) | 463 | void 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); |
diff --git a/include/linux/device.h b/include/linux/device.h index 2a73d9bcbc9c..aa5b3e66a147 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
| @@ -319,9 +319,9 @@ struct device_attribute { | |||
| 319 | struct device_attribute dev_attr_##_name = __ATTR(_name, _mode, _show, _store) | 319 | struct device_attribute dev_attr_##_name = __ATTR(_name, _mode, _show, _store) |
| 320 | 320 | ||
| 321 | extern int __must_check device_create_file(struct device *device, | 321 | extern int __must_check device_create_file(struct device *device, |
| 322 | struct device_attribute *entry); | 322 | const struct device_attribute *entry); |
| 323 | extern void device_remove_file(struct device *dev, | 323 | extern void device_remove_file(struct device *dev, |
| 324 | struct device_attribute *attr); | 324 | const struct device_attribute *attr); |
| 325 | extern int __must_check device_create_bin_file(struct device *dev, | 325 | extern int __must_check device_create_bin_file(struct device *dev, |
| 326 | struct bin_attribute *attr); | 326 | struct bin_attribute *attr); |
| 327 | extern void device_remove_bin_file(struct device *dev, | 327 | extern void device_remove_bin_file(struct device *dev, |
