mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
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 <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
8e9b936226
commit
26579ab70a
3 changed files with 10 additions and 8 deletions
|
|
@ -446,7 +446,8 @@ struct kset *devices_kset;
|
|||
* @dev: device.
|
||||
* @attr: device attribute descriptor.
|
||||
*/
|
||||
int device_create_file(struct device *dev, struct device_attribute *attr)
|
||||
int device_create_file(struct device *dev,
|
||||
const struct device_attribute *attr)
|
||||
{
|
||||
int error = 0;
|
||||
if (dev)
|
||||
|
|
@ -459,7 +460,8 @@ int device_create_file(struct device *dev, struct device_attribute *attr)
|
|||
* @dev: device.
|
||||
* @attr: device attribute descriptor.
|
||||
*/
|
||||
void device_remove_file(struct device *dev, struct device_attribute *attr)
|
||||
void device_remove_file(struct device *dev,
|
||||
const struct device_attribute *attr)
|
||||
{
|
||||
if (dev)
|
||||
sysfs_remove_file(&dev->kobj, &attr->attr);
|
||||
|
|
|
|||
Loading…
Reference in a new issue