lkml.org 
[lkml]   [2023]   [May]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] regulator: core: Streamline debugfs operations
Hi Mark,

On Tue, May 23, 2023 at 5:16 PM Mark Brown <broonie@kernel.org> wrote:
> On Tue, May 23, 2023 at 05:03:58PM +0200, Geert Uytterhoeven wrote:
>
> > - if (!regulator->debugfs) {
> > + if (IS_ERR(regulator->debugfs))
> > rdev_dbg(rdev, "Failed to create debugfs directory\n");
> > - } else {
> > - debugfs_create_u32("uA_load", 0444, regulator->debugfs,
> > - &regulator->uA_load);
> > - }
> > +
> > + debugfs_create_u32("uA_load", 0444, regulator->debugfs,
> > + &regulator->uA_load);
>
> No, it's actually useful to not just dump these files in the root
> directory if we fail to create the per regulator directory.

If regulator->debugfs is an error, no files are dumped in the root
directory.

By design, all debugfs functions are no-ops when passed an error,
cfr. the comment quoted above:

Other debugfs functions handle the fact that the "dentry"
passed to them could be an error and they don't crash in that case.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

\
 
 \ /
  Last update: 2023-05-24 08:43    [W:0.076 / U:0.568 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site