mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Lee Jones <lee@kernel.org>
Cc: sekoohaka.sarisan@gmail.com, mfd@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] mfd: intel-lpss: Fix DebugFS initialization
Date: Tue, 15 Sep 2026 16:32:08 +0300	[thread overview]
Message-ID: <aqlI2HgMCVyF1Xci@ashevche-desk.local> (raw)
In-Reply-To: <20260915110222.GA11487@google.com>

On Tue, Sep 15, 2026 at 12:02:22PM +0100, Lee Jones wrote:
> On Sun, 13 Sep 2026, Maria Lisina via B4 Relay wrote:

...

> >  static int __init intel_lpss_init(void)
> >  {
> >  	intel_lpss_debugfs = debugfs_create_dir("intel_lpss", NULL);
> 
> Why not move this and everything else debugfs related to
> intel_lpss_debugfs_add()?  Then we can get rid of the awful global
> variable, have everything nicely compartmentalised and ensure that we
> handle each fault gracefully?

This creates a directory under the root of the debugfs, so if you want to have
that not at the driver level, but at the device, it must be a singleton op.
We may achieve this by doing DO_ONCE_SLEEPABLE() from once.h.

Also note, this won't give us the possibility to kill the global variable, as
that one is per-driver, not per-device.

> > +	/* Ensure intel_lpss_debugfs stays NULL on error,
> > +	 * so intel_lpss_debugfs_add() exits properly.
> > +	 */
> > +	if (IS_ERR(intel_lpss_debugfs))
> > +		intel_lpss_debugfs = NULL;
> > +
> >  	return 0;
> >  }
> >  module_init(intel_lpss_init);

In any case it's orthogonal to the purpose of this patch AFAICS.
If you still think we definitely need to use probe (which I think
doesn't buy us anything but troubles with singleton), I can do it
later on.

-- 
With Best Regards,
Andy Shevchenko



      reply	other threads:[~2026-09-15 13:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-13 12:53 Maria Lisina via B4 Relay
2026-09-14  4:29 ` Andy Shevchenko
2026-09-15 11:02 ` Lee Jones
2026-09-15 13:32   ` Andy Shevchenko [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aqlI2HgMCVyF1Xci@ashevche-desk.local \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=lee@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mfd@lists.linux.dev \
    --cc=sekoohaka.sarisan@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®