All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maria Lisina <sekoohaka.sarisan@gmail.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	 Lee Jones <lee@kernel.org>
Cc: mfd@lists.linux.dev, linux-kernel@vger.kernel.org,
	 Maria Lisina <sekoohaka.sarisan@gmail.com>
Subject: [PATCH v6 1/4] mfd: intel-lpss: Remove redundant DebugFS error check
Date: Wed, 16 Sep 2026 19:36:39 +0500	[thread overview]
Message-ID: <20260916-intel-lpss-debugfs-v6-1-5c118ac430ed@gmail.com> (raw)
In-Reply-To: <20260916-intel-lpss-debugfs-v6-0-5c118ac430ed@gmail.com>

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


  reply	other threads:[~2026-09-16 14:37 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2026-09-16 15:45   ` [PATCH v6 1/4] mfd: intel-lpss: Remove redundant DebugFS error check 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

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=20260916-intel-lpss-debugfs-v6-1-5c118ac430ed@gmail.com \
    --to=sekoohaka.sarisan@gmail.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=lee@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mfd@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.