Re: [RFC PATCH 04/40] soundwire: intel: add debugfs register dump

Pierre-Louis Bossart
2019-07-26T15:34:43Z

>> +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.