usb: dwc3: debugfs: Re-use DEFINE_SHOW_ATTRIBUTE() macro
Andy Shevchenko
Reviewed-byQuoted 3 lines · Felipe Balbi
...instead of open coding file operations followed by custom ->open() callbacks per each attribute.
Reviewed-by Andy Shevchenko <[email protected]>
Though one comment below.
Review
Quoted 8 lines
Signed-off-by Felipe Balbi <[email protected]>static void dwc3_debugfs_create_endpoint_file(struct
dwc3_ep*dep,(quoted diff) +3
-0+ struct dentry *parent, const char *const name, + const struct file_operations *const fops) { + (void) debugfs_create_file(name, S_IRUGO, parent, dep, fops); }
At this point why do you need one line function anymore?
Quoted 2 lines
(quoted diff) +2
-0+ dwc3_debugfs_create_endpoint_file(dep, parent, + name, fops);