public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
	"Hans de Goede" <hdegoede@redhat.com>,
	linux-kernel@vger.kernel.org,
	platform-driver-x86@vger.kernel.org
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
	Daniel Scally <djrscally@gmail.com>
Subject: [PATCH v1 1/4] driver core: Ignore 0 in dev_err_probe()
Date: Wed, 21 Aug 2024 15:20:40 +0300	[thread overview]
Message-ID: <20240821122233.3761645-2-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20240821122233.3761645-1-andriy.shevchenko@linux.intel.com>

In the similar way, ignore 0 error code (AKA "success") in
dev_err_probe(). This helps to simplify a code such as

  if (ret < 0)
    return dev_err_probe(int3472->dev, ret, err_msg);

  return ret;

to

  return dev_err_probe(int3472->dev, ret, err_msg);

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/base/core.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/base/core.c b/drivers/base/core.c
index 6d3897492285..144cb8c201fb 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -5046,6 +5046,10 @@ int dev_err_probe(const struct device *dev, int err, const char *fmt, ...)
 		 */
 		break;
 
+	case 0:
+		/* Success, no need to issue an error message */
+		break;
+
 	default:
 		dev_err(dev, "error %pe: %pV", ERR_PTR(err), &vaf);
 		break;
-- 
2.43.0.rc1.1336.g36b5255a03ac


  reply	other threads:[~2024-08-21 12:22 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-21 12:20 [PATCH v1 0/4] platform/x86: int3472: A few cleanups Andy Shevchenko
2024-08-21 12:20 ` Andy Shevchenko [this message]
2024-08-21 12:38   ` [PATCH v1 1/4] driver core: Ignore 0 in dev_err_probe() Ilpo Järvinen
2024-08-21 13:12     ` Andy Shevchenko
2024-08-21 23:32       ` Greg Kroah-Hartman
2024-08-22 12:45         ` Andy Shevchenko
2024-08-21 12:20 ` [PATCH v1 2/4] platform/x86: int3472: Simplify dev_err_probe() usage Andy Shevchenko
2024-08-21 12:35   ` Christophe JAILLET
2024-08-21 12:39     ` Ilpo Järvinen
2024-08-21 12:41       ` Christophe JAILLET
2024-08-21 12:39   ` Ilpo Järvinen
2024-08-21 12:20 ` [PATCH v1 3/4] platform/x86: int3472: Use GPIO_LOOKUP() macro Andy Shevchenko
2024-08-21 12:41   ` Ilpo Järvinen
2024-08-21 12:20 ` [PATCH v1 4/4] platform/x86: int3472: Use str_high_low() Andy Shevchenko
2024-08-21 12:33   ` Ilpo Järvinen

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=20240821122233.3761645-2-andriy.shevchenko@linux.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=djrscally@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hdegoede@redhat.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=rafael@kernel.org \
    /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