[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240323222506.4ffbdd71@thinkpad>
Date: Sat, 23 Mar 2024 22:25:06 +0100
From: Marek BehĂșn <kabel@...nel.org>
To: Christophe JAILLET <christophe.jaillet@...adoo.fr>
Cc: 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, 23 Mar 2024 22:10:40 +0100
Christophe JAILLET <christophe.jaillet@...adoo.fr> wrote:
> > - return devm_add_action_or_reset(dev, gpio_mockup_debugfs_cleanup, chip);
> > + return devm_add_action_or_reset(dev, devm_debugfs_dir_recursive_drop,
> > + chip->dbg_dir);
>
> This look strange. Shouldn't the debugfs_create_dir() call in
> gpio_mockup_debugfs_setup() be changed, instead?
>
> (I've not look in the previous version if something was said about it,
> so apologies if already discussed)
Yeah, this specific user needs a more complicated refactoring.
I was reluctant to do more complicated refactors in the patch that also
introduces these helpers.
But Guenter asked me to split the patch anyway...
> > 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.
> *If I'm correct*, functions related to debugfs already handle this case
> and just do nothing. And failure in debugfs related code is not
> considered as something that need to be reported and abort a probe function.
>
> Maybe the same other (already existing) tests in this patch should be
> removed as well, in a separated patch.
Functions related to debugfs maybe do, but devm_ resource management
functions may fail to allocate release structure, and those errors need
to be handled, AFAIK.
Marek
Powered by blists - more mailing lists