lkml.org 
[lkml]   [2019]   [Jul]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC PATCH 04/40] soundwire: intel: add debugfs register dump
From
Date

>> +static const struct file_operations intel_reg_fops = {
>> + .open = simple_open,
>> + .read = intel_reg_read,
>> + .llseek = default_llseek,
>> +};
>
> DEFINE_SIMPLE_ATTRIBUTE()?

yes

>
>> +
>> +static void intel_debugfs_init(struct sdw_intel *sdw)
>> +{
>> + struct dentry *root = sdw->cdns.bus.debugfs;
>> +
>> + if (!root)
>> + return;
>> +
>> + sdw->fs = debugfs_create_dir("intel-sdw", root);
>> + if (IS_ERR_OR_NULL(sdw->fs)) {
>> + dev_err(sdw->cdns.dev, "debugfs root creation failed\n");
>
> No, come on, don't do that. I've been sweeping the kernel tree to
> remove this anti-pattern.
>
> The debugfs core will print an error if you got something wrong, just
> call the function and move on, you NEVER need to check the return value
> of a debugfs call.

Yes, sorry to make your blood pressure go up... I missed this one in the
cleanups yesterday. will fix.

\
 
 \ /
  Last update: 2019-07-26 17:40    [W:0.132 / U:0.668 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site