* [PATCH v6 0/4] mfd: intel-lpss: Clean up and modernize DebugFS usage
@ 2026-09-16 14:36 Maria Lisina
2026-09-16 14:36 ` [PATCH v6 1/4] mfd: intel-lpss: Remove redundant DebugFS error check Maria Lisina
` (3 more replies)
0 siblings, 4 replies; 12+ messages in thread
From: Maria Lisina @ 2026-09-16 14:36 UTC (permalink / raw)
To: Andy Shevchenko, Lee Jones; +Cc: mfd, linux-kernel, Maria Lisina
This series cleans up DebugFS code, modernizes it by replacing
obsoleted macros and removes redundant error checking.
Signed-off-by: Maria Lisina <sekoohaka.sarisan@gmail.com>
---
Changes in v6:
- Split each logical change into an individual patch.
- Link to v5: https://lore.kernel.org/r/20260916-intel-lpss-debugfs-v5-1-99295f534067@gmail.com
Changes in v5:
- Changed the goal of the patch to DebugFS modernization.
- Refactored intel_lpss_debugfs_add() into a void function.
- Removed deprecated macros and functions.
- Removed dmesg message completely.
- Link to v4: https://lore.kernel.org/r/20260914-intel-lpss-debugfs-v4-1-0eb82ea7c1e3@gmail.com
Changes in v4:
- Keep the dmesg messages, instead check whether DebugFS is initialized
- Link to v3: https://lore.kernel.org/r/20260913-intel-lpss-debugfs-v3-1-1b8e2b1f0992@gmail.com
Changes in v3:
- Fixed commit name and description.
- Link to v2: https://lore.kernel.org/r/20260913-intel-lpss-debugfs-v2-1-a1a4faf5cc63@gmail.com
Changes in v2:
- Fixed function name in comment section.
- Link to v1: https://lore.kernel.org/r/20260913-intel-lpss-debugfs-v1-1-833cbb6fffc9@gmail.com
---
Maria Lisina (4):
mfd: intel-lpss: Remove redundant DebugFS error check
mfd: intel-lpss: Use plain octal values for file permissions
mfd: intel-lpss: Remove extra DebugFS dentry
mfd: intel-lpss: Switch to debugfs_remove()
drivers/mfd/intel-lpss.c | 28 +++++++++++-----------------
1 file changed, 11 insertions(+), 17 deletions(-)
---
base-commit: 2f0c1cf72f4682178506f513bbf015e591b1aa4a
change-id: 20260913-intel-lpss-debugfs-eff3580d1295
Best regards,
--
Maria Lisina <sekoohaka.sarisan@gmail.com>
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH v6 1/4] mfd: intel-lpss: Remove redundant DebugFS error check
2026-09-16 14:36 [PATCH v6 0/4] mfd: intel-lpss: Clean up and modernize DebugFS usage Maria Lisina
@ 2026-09-16 14:36 ` Maria Lisina
2026-09-16 15:45 ` Andy Shevchenko
2026-09-16 14:36 ` [PATCH v6 2/4] mfd: intel-lpss: Use plain octal values for file permissions Maria Lisina
` (2 subsequent siblings)
3 siblings, 1 reply; 12+ messages in thread
From: Maria Lisina @ 2026-09-16 14:36 UTC (permalink / raw)
To: Andy Shevchenko, Lee Jones; +Cc: mfd, linux-kernel, Maria Lisina
The DebugFS API is designed to handle errors gracefully.
Any explicit checking on return values is considered an anti-pattern.
This patch removes unnecessary error checking and converts
intel_lpss_debugfs_add() into a void function.
Signed-off-by: Maria Lisina <sekoohaka.sarisan@gmail.com>
---
drivers/mfd/intel-lpss.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/drivers/mfd/intel-lpss.c b/drivers/mfd/intel-lpss.c
index 63d6694f71457b2e09d238af0a9bfb897a169a64..b6958e99cf54d3c8eeca1ba38055a9389678f6c3 100644
--- a/drivers/mfd/intel-lpss.c
+++ b/drivers/mfd/intel-lpss.c
@@ -142,13 +142,11 @@ static void intel_lpss_cache_ltr(struct intel_lpss *lpss)
lpss->idle_ltr = readl(lpss->priv + LPSS_PRIV_IDLELTR);
}
-static int intel_lpss_debugfs_add(struct intel_lpss *lpss)
+static void intel_lpss_debugfs_add(struct intel_lpss *lpss)
{
struct dentry *dir;
dir = debugfs_create_dir(dev_name(lpss->dev), intel_lpss_debugfs);
- if (IS_ERR(dir))
- return PTR_ERR(dir);
/* Cache the values into lpss structure */
intel_lpss_cache_ltr(lpss);
@@ -158,7 +156,6 @@ static int intel_lpss_debugfs_add(struct intel_lpss *lpss)
debugfs_create_x32("idle_ltr", S_IRUGO, dir, &lpss->idle_ltr);
lpss->debugfs = dir;
- return 0;
}
static void intel_lpss_debugfs_remove(struct intel_lpss *lpss)
@@ -432,10 +429,7 @@ int intel_lpss_probe(struct device *dev,
goto err_clk_register;
intel_lpss_ltr_expose(lpss);
-
- ret = intel_lpss_debugfs_add(lpss);
- if (ret)
- dev_warn(dev, "Failed to create debugfs entries\n");
+ intel_lpss_debugfs_add(lpss);
if (intel_lpss_has_idma(lpss)) {
ret = mfd_add_devices(dev, lpss->devid, &intel_lpss_idma64_cell,
--
2.47.3
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH v6 2/4] mfd: intel-lpss: Use plain octal values for file permissions
2026-09-16 14:36 [PATCH v6 0/4] mfd: intel-lpss: Clean up and modernize DebugFS usage Maria Lisina
2026-09-16 14:36 ` [PATCH v6 1/4] mfd: intel-lpss: Remove redundant DebugFS error check Maria Lisina
@ 2026-09-16 14:36 ` Maria Lisina
2026-09-16 15:46 ` Andy Shevchenko
2026-09-16 14:36 ` [PATCH v6 3/4] mfd: intel-lpss: Remove extra DebugFS dentry Maria Lisina
2026-09-16 14:36 ` [PATCH v6 4/4] mfd: intel-lpss: Switch to debugfs_remove() Maria Lisina
3 siblings, 1 reply; 12+ messages in thread
From: Maria Lisina @ 2026-09-16 14:36 UTC (permalink / raw)
To: Andy Shevchenko, Lee Jones; +Cc: mfd, linux-kernel, Maria Lisina
S_IRUGO macro is obsoleted and not recommended to use,
therefore replace it with plain octal values.
Signed-off-by: Maria Lisina <sekoohaka.sarisan@gmail.com>
---
drivers/mfd/intel-lpss.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/mfd/intel-lpss.c b/drivers/mfd/intel-lpss.c
index b6958e99cf54d3c8eeca1ba38055a9389678f6c3..190de88d146aae9418566adf36a47d11afa90b2a 100644
--- a/drivers/mfd/intel-lpss.c
+++ b/drivers/mfd/intel-lpss.c
@@ -151,9 +151,9 @@ static void intel_lpss_debugfs_add(struct intel_lpss *lpss)
/* Cache the values into lpss structure */
intel_lpss_cache_ltr(lpss);
- debugfs_create_x32("capabilities", S_IRUGO, dir, &lpss->caps);
- debugfs_create_x32("active_ltr", S_IRUGO, dir, &lpss->active_ltr);
- debugfs_create_x32("idle_ltr", S_IRUGO, dir, &lpss->idle_ltr);
+ debugfs_create_x32("capabilities", 0444, dir, &lpss->caps);
+ debugfs_create_x32("active_ltr", 0444, dir, &lpss->active_ltr);
+ debugfs_create_x32("idle_ltr", 0444, dir, &lpss->idle_ltr);
lpss->debugfs = dir;
}
--
2.47.3
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH v6 3/4] mfd: intel-lpss: Remove extra DebugFS dentry
2026-09-16 14:36 [PATCH v6 0/4] mfd: intel-lpss: Clean up and modernize DebugFS usage Maria Lisina
2026-09-16 14:36 ` [PATCH v6 1/4] mfd: intel-lpss: Remove redundant DebugFS error check Maria Lisina
2026-09-16 14:36 ` [PATCH v6 2/4] mfd: intel-lpss: Use plain octal values for file permissions Maria Lisina
@ 2026-09-16 14:36 ` Maria Lisina
2026-09-16 15:44 ` Andy Shevchenko
2026-09-16 14:36 ` [PATCH v6 4/4] mfd: intel-lpss: Switch to debugfs_remove() Maria Lisina
3 siblings, 1 reply; 12+ messages in thread
From: Maria Lisina @ 2026-09-16 14:36 UTC (permalink / raw)
To: Andy Shevchenko, Lee Jones; +Cc: mfd, linux-kernel, Maria Lisina
There is no point to keep the variable dir just to assing
lpss->debugfs to it later, just use lpss->debugfs directly.
Signed-off-by: Maria Lisina <sekoohaka.sarisan@gmail.com>
---
drivers/mfd/intel-lpss.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/mfd/intel-lpss.c b/drivers/mfd/intel-lpss.c
index 190de88d146aae9418566adf36a47d11afa90b2a..f1a8feb0fdf2042a3b6a8422400cb8f9511b4876 100644
--- a/drivers/mfd/intel-lpss.c
+++ b/drivers/mfd/intel-lpss.c
@@ -144,18 +144,18 @@ static void intel_lpss_cache_ltr(struct intel_lpss *lpss)
static void intel_lpss_debugfs_add(struct intel_lpss *lpss)
{
- struct dentry *dir;
-
- dir = debugfs_create_dir(dev_name(lpss->dev), intel_lpss_debugfs);
+ lpss->debugfs = debugfs_create_dir(dev_name(lpss->dev),
+ intel_lpss_debugfs);
/* Cache the values into lpss structure */
intel_lpss_cache_ltr(lpss);
- debugfs_create_x32("capabilities", 0444, dir, &lpss->caps);
- debugfs_create_x32("active_ltr", 0444, dir, &lpss->active_ltr);
- debugfs_create_x32("idle_ltr", 0444, dir, &lpss->idle_ltr);
-
- lpss->debugfs = dir;
+ debugfs_create_x32("capabilities", 0444,
+ lpss->debugfs, &lpss->caps);
+ debugfs_create_x32("active_ltr", 0444,
+ lpss->debugfs, &lpss->active_ltr);
+ debugfs_create_x32("idle_ltr", 0444,
+ lpss->debugfs, &lpss->idle_ltr);
}
static void intel_lpss_debugfs_remove(struct intel_lpss *lpss)
--
2.47.3
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH v6 4/4] mfd: intel-lpss: Switch to debugfs_remove()
2026-09-16 14:36 [PATCH v6 0/4] mfd: intel-lpss: Clean up and modernize DebugFS usage Maria Lisina
` (2 preceding siblings ...)
2026-09-16 14:36 ` [PATCH v6 3/4] mfd: intel-lpss: Remove extra DebugFS dentry Maria Lisina
@ 2026-09-16 14:36 ` Maria Lisina
2026-09-16 15:47 ` Andy Shevchenko
3 siblings, 1 reply; 12+ messages in thread
From: Maria Lisina @ 2026-09-16 14:36 UTC (permalink / raw)
To: Andy Shevchenko, Lee Jones; +Cc: mfd, linux-kernel, Maria Lisina
debugfs_remove_recursive() is deprecated and has become
a macro for debugfs_remove(), replace it with the direct
debugfs_remove() call instead.
Signed-off-by: Maria Lisina <sekoohaka.sarisan@gmail.com>
---
drivers/mfd/intel-lpss.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mfd/intel-lpss.c b/drivers/mfd/intel-lpss.c
index f1a8feb0fdf2042a3b6a8422400cb8f9511b4876..beb01252f9021bbf40b293c81181b29e9b61bf56 100644
--- a/drivers/mfd/intel-lpss.c
+++ b/drivers/mfd/intel-lpss.c
@@ -160,7 +160,7 @@ static void intel_lpss_debugfs_add(struct intel_lpss *lpss)
static void intel_lpss_debugfs_remove(struct intel_lpss *lpss)
{
- debugfs_remove_recursive(lpss->debugfs);
+ debugfs_remove(lpss->debugfs);
}
static void intel_lpss_ltr_set(struct device *dev, s32 val)
--
2.47.3
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v6 3/4] mfd: intel-lpss: Remove extra DebugFS dentry
2026-09-16 14:36 ` [PATCH v6 3/4] mfd: intel-lpss: Remove extra DebugFS dentry Maria Lisina
@ 2026-09-16 15:44 ` Andy Shevchenko
2026-09-16 15:46 ` Andy Shevchenko
2026-09-16 15:54 ` Maria Lisina
0 siblings, 2 replies; 12+ messages in thread
From: Andy Shevchenko @ 2026-09-16 15:44 UTC (permalink / raw)
To: Maria Lisina; +Cc: Lee Jones, mfd, linux-kernel
On Wed, Sep 16, 2026 at 07:36:41PM +0500, Maria Lisina wrote:
> There is no point to keep the variable dir just to assing
> lpss->debugfs to it later, just use lpss->debugfs directly.
...
> static void intel_lpss_debugfs_add(struct intel_lpss *lpss)
> {
> - struct dentry *dir;
> -
> - dir = debugfs_create_dir(dev_name(lpss->dev), intel_lpss_debugfs);
> + lpss->debugfs = debugfs_create_dir(dev_name(lpss->dev),
> + intel_lpss_debugfs);
As Lee pointed out, we are fine with 100 limit, so one line here and below.
> /* Cache the values into lpss structure */
> intel_lpss_cache_ltr(lpss);
>
> - debugfs_create_x32("capabilities", 0444, dir, &lpss->caps);
> - debugfs_create_x32("active_ltr", 0444, dir, &lpss->active_ltr);
> - debugfs_create_x32("idle_ltr", 0444, dir, &lpss->idle_ltr);
> -
> - lpss->debugfs = dir;
> + debugfs_create_x32("capabilities", 0444,
> + lpss->debugfs, &lpss->caps);
> + debugfs_create_x32("active_ltr", 0444,
> + lpss->debugfs, &lpss->active_ltr);
> + debugfs_create_x32("idle_ltr", 0444,
> + lpss->debugfs, &lpss->idle_ltr);
> }
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v6 1/4] mfd: intel-lpss: Remove redundant DebugFS error check
2026-09-16 14:36 ` [PATCH v6 1/4] mfd: intel-lpss: Remove redundant DebugFS error check Maria Lisina
@ 2026-09-16 15:45 ` Andy Shevchenko
0 siblings, 0 replies; 12+ messages in thread
From: Andy Shevchenko @ 2026-09-16 15:45 UTC (permalink / raw)
To: Maria Lisina; +Cc: Lee Jones, mfd, linux-kernel
On Wed, Sep 16, 2026 at 07:36:39PM +0500, Maria Lisina wrote:
> The DebugFS API is designed to handle errors gracefully.
> Any explicit checking on return values is considered an anti-pattern.
>
> This patch removes unnecessary error checking and converts
> intel_lpss_debugfs_add() into a void function.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v6 2/4] mfd: intel-lpss: Use plain octal values for file permissions
2026-09-16 14:36 ` [PATCH v6 2/4] mfd: intel-lpss: Use plain octal values for file permissions Maria Lisina
@ 2026-09-16 15:46 ` Andy Shevchenko
0 siblings, 0 replies; 12+ messages in thread
From: Andy Shevchenko @ 2026-09-16 15:46 UTC (permalink / raw)
To: Maria Lisina; +Cc: Lee Jones, mfd, linux-kernel
On Wed, Sep 16, 2026 at 07:36:40PM +0500, Maria Lisina wrote:
> S_IRUGO macro is obsoleted and not recommended to use,
> therefore replace it with plain octal values.
Yep, octal permissions much easier to get without looking aside!
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v6 3/4] mfd: intel-lpss: Remove extra DebugFS dentry
2026-09-16 15:44 ` Andy Shevchenko
@ 2026-09-16 15:46 ` Andy Shevchenko
2026-09-16 15:54 ` Maria Lisina
1 sibling, 0 replies; 12+ messages in thread
From: Andy Shevchenko @ 2026-09-16 15:46 UTC (permalink / raw)
To: Maria Lisina; +Cc: Lee Jones, mfd, linux-kernel
On Wed, Sep 16, 2026 at 06:44:59PM +0300, Andy Shevchenko wrote:
> On Wed, Sep 16, 2026 at 07:36:41PM +0500, Maria Lisina wrote:
...
> > static void intel_lpss_debugfs_add(struct intel_lpss *lpss)
> > {
> > - struct dentry *dir;
> > -
> > - dir = debugfs_create_dir(dev_name(lpss->dev), intel_lpss_debugfs);
> > + lpss->debugfs = debugfs_create_dir(dev_name(lpss->dev),
> > + intel_lpss_debugfs);
>
> As Lee pointed out, we are fine with 100 limit, so one line here and below.
After addressing this feel free to add
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > /* Cache the values into lpss structure */
> > intel_lpss_cache_ltr(lpss);
> >
> > - debugfs_create_x32("capabilities", 0444, dir, &lpss->caps);
> > - debugfs_create_x32("active_ltr", 0444, dir, &lpss->active_ltr);
> > - debugfs_create_x32("idle_ltr", 0444, dir, &lpss->idle_ltr);
> > -
> > - lpss->debugfs = dir;
> > + debugfs_create_x32("capabilities", 0444,
> > + lpss->debugfs, &lpss->caps);
> > + debugfs_create_x32("active_ltr", 0444,
> > + lpss->debugfs, &lpss->active_ltr);
> > + debugfs_create_x32("idle_ltr", 0444,
> > + lpss->debugfs, &lpss->idle_ltr);
> > }
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v6 4/4] mfd: intel-lpss: Switch to debugfs_remove()
2026-09-16 14:36 ` [PATCH v6 4/4] mfd: intel-lpss: Switch to debugfs_remove() Maria Lisina
@ 2026-09-16 15:47 ` Andy Shevchenko
0 siblings, 0 replies; 12+ messages in thread
From: Andy Shevchenko @ 2026-09-16 15:47 UTC (permalink / raw)
To: Maria Lisina; +Cc: Lee Jones, mfd, linux-kernel
On Wed, Sep 16, 2026 at 07:36:42PM +0500, Maria Lisina wrote:
> debugfs_remove_recursive() is deprecated and has become
> a macro for debugfs_remove(), replace it with the direct
a macro for --> an alias to
> debugfs_remove() call instead.
With the above amendment,
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v6 3/4] mfd: intel-lpss: Remove extra DebugFS dentry
2026-09-16 15:44 ` Andy Shevchenko
2026-09-16 15:46 ` Andy Shevchenko
@ 2026-09-16 15:54 ` Maria Lisina
2026-09-16 16:04 ` Andy Shevchenko
1 sibling, 1 reply; 12+ messages in thread
From: Maria Lisina @ 2026-09-16 15:54 UTC (permalink / raw)
To: andriy.shevchenko; +Cc: lee, linux-kernel, mfd, sekoohaka.sarisan
> As Lee pointed out, we are fine with 100 limit, so one line here and below.
But doesn't the guideline strictly say no more than 80?
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v6 3/4] mfd: intel-lpss: Remove extra DebugFS dentry
2026-09-16 15:54 ` Maria Lisina
@ 2026-09-16 16:04 ` Andy Shevchenko
0 siblings, 0 replies; 12+ messages in thread
From: Andy Shevchenko @ 2026-09-16 16:04 UTC (permalink / raw)
To: Maria Lisina; +Cc: lee, linux-kernel, mfd
On Wed, Sep 16, 2026 at 08:54:07PM +0500, Maria Lisina wrote:
> > As Lee pointed out, we are fine with 100 limit, so one line here and below.
>
> But doesn't the guideline strictly say no more than 80?
Yes it says, some maintainers used relaxed version (which is default in
checkpatch and now it's 100). Lee is the maintainer of the MFD subsystem
and it's clear he leans towards using 100 limit.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2026-09-16 16:04 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-16 14:36 [PATCH v6 0/4] mfd: intel-lpss: Clean up and modernize DebugFS usage Maria Lisina
2026-09-16 14:36 ` [PATCH v6 1/4] mfd: intel-lpss: Remove redundant DebugFS error check Maria Lisina
2026-09-16 15:45 ` Andy Shevchenko
2026-09-16 14:36 ` [PATCH v6 2/4] mfd: intel-lpss: Use plain octal values for file permissions Maria Lisina
2026-09-16 15:46 ` Andy Shevchenko
2026-09-16 14:36 ` [PATCH v6 3/4] mfd: intel-lpss: Remove extra DebugFS dentry Maria Lisina
2026-09-16 15:44 ` Andy Shevchenko
2026-09-16 15:46 ` Andy Shevchenko
2026-09-16 15:54 ` Maria Lisina
2026-09-16 16:04 ` Andy Shevchenko
2026-09-16 14:36 ` [PATCH v6 4/4] mfd: intel-lpss: Switch to debugfs_remove() Maria Lisina
2026-09-16 15:47 ` Andy Shevchenko
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®