[PATCH 2/2] firmware: imx: sm-misc: Dump syslog info

Peng Fan peng.fan at nxp.com
Wed Sep 10 22:47:03 PDT 2025


> Subject: Re: [PATCH 2/2] firmware: imx: sm-misc: Dump syslog info
> 
> On Wed, Sep 10, 2025 at 10:28:18PM +0800, Peng Fan wrote:
> >  static int scmi_imx_misc_ctrl_probe(struct scmi_device *sdev)  {
> >  	const struct scmi_handle *handle = sdev->handle;
> >  	struct device_node *np = sdev->dev.of_node;
> > +	struct dentry *scmi_imx_dentry;
> >  	u32 src_id, flags;
> >  	int ret, i, num;
> >
> > @@ -98,6 +134,12 @@ static int scmi_imx_misc_ctrl_probe(struct
> scmi_device *sdev)
> >  		}
> >  	}
> >
> > +	scmi_imx_dentry = debugfs_create_dir("scmi_imx", NULL);
> > +	if (!IS_ERR(scmi_imx_dentry))
> > +		debugfs_create_file("syslog", 0444, scmi_imx_dentry,
> &sdev->dev,
> > +&syslog_fops);
> 
> You don't need the IS_ERR() check.  If debugfs_create_dir() fails then
> just pass the error pointer to debugfs_create_file(), it's fine.

Hi Dan,

Thanks for raising this. I will fix in next version.

Thanks,
Peng.

> 
> regards,
> dan carpenter
> 
> > +
> > +	devm_add_action_or_reset(&sdev->dev, scmi_imx_misc_put,
> > +scmi_imx_dentry);
> > +
> >  	return 0;
> >  }
> >
> >
> > --
> > 2.37.1
> >



More information about the linux-arm-kernel mailing list