public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Artem Shimko <a.shimko.dev@gmail.com>
To: Mika Westerberg <mika.westerberg@linux.intel.com>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Jan Dabros <jsd@semihalf.com>, Andi Shyti <andi.shyti@kernel.org>,
	Philipp Zabel <p.zabel@pengutronix.de>
Cc: Artem Shimko <a.shimko.dev@gmail.com>,
	linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH RESEND] i2c: designware-platdrv: handle reset control deassert error
Date: Tue, 11 Nov 2025 10:53:59 +0300	[thread overview]
Message-ID: <20251111075400.2982270-1-a.shimko.dev@gmail.com> (raw)

Handle the error returned by reset_control_deassert() in the probe
function to prevent continuing probe when reset deassertion fails.

Previously, reset_control_deassert() was called without checking its
return value, which could lead to probe continuing even when the
device reset wasn't properly deasserted.

The fix checks the return value and returns an error with dev_err_probe()
if reset deassertion fails, providing better error handling.

Signed-off-by: Artem Shimko <a.shimko.dev@gmail.com>
---

Hi,

Resending this patch that seems to have been overlooked.
Thanks for your time.

Previous discussion: https://lore.kernel.org/all/c863512af9a13eb92bde7e0d383d4b4c81e5ce3e.camel@pengutronix.de/T/#t

--
Regards
Artem

 drivers/i2c/busses/i2c-designware-platdrv.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
index 34d881572351..bfaedb851511 100644
--- a/drivers/i2c/busses/i2c-designware-platdrv.c
+++ b/drivers/i2c/busses/i2c-designware-platdrv.c
@@ -240,7 +240,9 @@ static int dw_i2c_plat_probe(struct platform_device *pdev)
 	if (IS_ERR(dev->rst))
 		return dev_err_probe(device, PTR_ERR(dev->rst), "failed to acquire reset\n");
 
-	reset_control_deassert(dev->rst);
+	ret = reset_control_deassert(dev->rst);
+	if (ret)
+		return dev_err_probe(device, ret, "Failed to deassert reset\n");
 
 	ret = i2c_dw_fw_parse_and_configure(dev);
 	if (ret)
-- 
2.43.0


             reply	other threads:[~2025-11-11  7:54 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-11  7:53 Artem Shimko [this message]
2025-11-11  9:15 ` [PATCH RESEND] i2c: designware-platdrv: handle reset control deassert error Philipp Zabel
2025-11-11 11:45   ` [PATCH v2 1/3] i2c: designware-platdrv: simplify reset control with devm variant Artem Shimko
2025-11-11 11:45     ` [PATCH v2 2/3] i2c: designware-platdrv: complete reset control devm conversion Artem Shimko
2025-11-11 12:43       ` Philipp Zabel
2025-11-11 14:09         ` [PATCH v3] i2c: designware-platdrv: simplify reset control and error handling Artem Shimko
2025-11-11 14:33           ` Philipp Zabel
2025-11-11 14:33         ` [PATCH v2 2/3] i2c: designware-platdrv: complete reset control devm conversion Philipp Zabel
2025-11-11 14:55           ` [PATCH v4] i2c: designware-platdrv: simplify reset control and error handling Artem Shimko
2026-01-20 13:55             ` Andi Shyti
2025-11-11 11:45     ` [PATCH v2 3/3] i2c: designware-platdrv: streamline " Artem Shimko

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=20251111075400.2982270-1-a.shimko.dev@gmail.com \
    --to=a.shimko.dev@gmail.com \
    --cc=andi.shyti@kernel.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=jsd@semihalf.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    --cc=p.zabel@pengutronix.de \
    /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