mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-02 13:23:35 -04:00
media: staging: atomisp2: replace DEVICE_ATTR with DEVICE_ATTR_RO
This is a clean-up patch which replaces DEVICE_ATTR() macro with file
permission specific DEVICE_ATTR_RO() macro for compaction and
readability.
Done using coccinelle:
@r@
identifier attr, show_fn;
declarer name DEVICE_ATTR;
@@
DEVICE_ATTR(attr, \(S_IRUGO\|0444\), show_fn, NULL);
@script: python p@
attr_show;
attr << r.attr;
@@
// standardise the show fn name to {attr}_show
coccinelle.attr_show = attr + "_show"
@@
identifier r.attr, r.show_fn;
declarer name DEVICE_ATTR_RO;
@@
// change the attr declaration
- DEVICE_ATTR(attr, \(S_IRUGO\|0444\), show_fn, NULL);
+ DEVICE_ATTR_RO(attr);
@rr@
identifier r.show_fn, p.attr_show;
@@
// rename the show function
- show_fn
+ attr_show
(...) {
...
}
@depends on rr@
identifier r.show_fn, p.attr_show;
@@
// rename fn usages
- show_fun
+ attr_show
Signed-off-by: Aishwarya Pant <aishpant@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
This commit is contained in:
committed by
Mauro Carvalho Chehab
parent
eae79ed596
commit
5fac8da586
@@ -158,10 +158,10 @@ static ssize_t dynamic_pool_show(struct device *dev,
|
||||
return ret;
|
||||
};
|
||||
|
||||
static DEVICE_ATTR(active_bo, 0444, active_bo_show, NULL);
|
||||
static DEVICE_ATTR(free_bo, 0444, free_bo_show, NULL);
|
||||
static DEVICE_ATTR(reserved_pool, 0444, reserved_pool_show, NULL);
|
||||
static DEVICE_ATTR(dynamic_pool, 0444, dynamic_pool_show, NULL);
|
||||
static DEVICE_ATTR_RO(active_bo);
|
||||
static DEVICE_ATTR_RO(free_bo);
|
||||
static DEVICE_ATTR_RO(reserved_pool);
|
||||
static DEVICE_ATTR_RO(dynamic_pool);
|
||||
|
||||
static struct attribute *sysfs_attrs_ctrl[] = {
|
||||
&dev_attr_active_bo.attr,
|
||||
|
||||
Reference in New Issue
Block a user