[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <486947a7-98fc-4884-a5fd-354677fa66ce@moroto.mountain>
Date: Mon, 25 Mar 2024 14:05:29 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Christophe JAILLET <christophe.jaillet@...adoo.fr>
Cc: Marek BehĂșn <kabel@...nel.org>,
Jonathan.Cameron@...wei.com, Laurent.pinchart@...asonboard.com,
airlied@...il.com, andrzej.hajda@...el.com, arm@...nel.org,
arnd@...db.de, bamv2005@...il.com, brgl@...ev.pl, daniel@...ll.ch,
davem@...emloft.net, dianders@...omium.org,
dri-devel@...ts.freedesktop.org, eajames@...ux.ibm.com,
gaurav.jain@....com, gregory.clement@...tlin.com,
hdegoede@...hat.com, herbert@...dor.apana.org.au,
horia.geanta@....com, james.clark@....com, james@...iv.tech,
jdelvare@...e.com, jernej.skrabec@...il.com, jonas@...boo.se,
linus.walleij@...aro.org, linux-crypto@...r.kernel.org,
linux-gpio@...r.kernel.org, linux-hwmon@...r.kernel.org,
linux-kernel@...r.kernel.org, linux@...ck-us.net,
maarten.lankhorst@...ux.intel.com, mazziesaccount@...il.com,
mripard@...nel.org, naresh.solanki@...ements.com,
neil.armstrong@...aro.org, pankaj.gupta@....com,
patrick.rudolph@...ements.com, rfoss@...nel.org, soc@...nel.org,
tzimmermann@...e.de
Subject: Re: [PATCH v5 08/11] devm-helpers: Add resource managed version of
debugfs directory create function
On Sat, Mar 23, 2024 at 10:10:40PM +0100, Christophe JAILLET wrote:
> > static int pvt_ts_dbgfs_create(struct pvt_device *pvt, struct device *dev)
> > {
> > - pvt->dbgfs_dir = debugfs_create_dir(dev_name(dev), NULL);
> > + pvt->dbgfs_dir = devm_debugfs_create_dir(dev, dev_name(dev), NULL);
> > + if (IS_ERR(pvt->dbgfs_dir))
> > + return PTR_ERR(pvt->dbgfs_dir);
>
> Not sure if the test and error handling should be added here.
Yep. debugfs_create_dir() is not supposed to be checked here. It
breaks the driver if CONFIG_DEBUGFS is disabled. I have written a blog
about this:
https://staticthinking.wordpress.com/2023/07/24/debugfs-functions-are-not-supposed-to-be-checked/
regards,
dan carpenter
Powered by blists - more mailing lists