public inbox for linux-kernel-mentees@lists.linux-foundation.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Aldo Conte <aldocontelk@gmail.com>
Cc: jic23@kernel.org, ktsai@capellamicro.com, dlechner@baylibre.com,
	nuno.sa@analog.com, andy@kernel.org, daniel.baluta@intel.com,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
	skhan@linuxfoundation.org, me@brighamcampbell.com,
	linux-kernel-mentees@lists.linux.dev
Subject: Re: [PATCH 2/2] iio: light: cm3323: use dev_err_probe() in probe path
Date: Thu, 2 Apr 2026 19:12:39 +0300	[thread overview]
Message-ID: <ac6Vd0YM06tJXzJO@ashevche-desk.local> (raw)
In-Reply-To: <20260402151730.18901-3-aldocontelk@gmail.com>

On Thu, Apr 02, 2026 at 05:17:30PM +0200, Aldo Conte wrote:
> Replace dev_err() calls with dev_err_probe() in cm3323_init() and
> cm3323_probe(). cm3323_init() is called by cm3323_probe() ,  so using
> dev_err_probe() ensures that deferred probing is handled
> correctly and simplifies error paths.
> 
> Remove the redundant error message in cm3323_probe().
> 
> Tested on a Raspberry Pi 3B using i2c-stub. The driver probes
> successfully and successfully read integration_time after this change.

...

> +		return dev_err_probe(&data->client->dev, ret,
> +				     "Error reading reg_conf\n");

Add

	struct device *dev = &data->client->dev;

at the top of the function and make these just to be one-liners.

-- 
With Best Regards,
Andy Shevchenko



      reply	other threads:[~2026-04-02 16:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-02 15:17 [PATCH 0/2] Subject: [PATCH 0/2] iio: light: cm3323: fix and cleanup Aldo Conte
2026-04-02 15:17 ` [PATCH 1/2] iio: light: cm3323: fix reg_conf not being initialized correctly Aldo Conte
2026-04-02 16:14   ` Andy Shevchenko
2026-04-02 15:17 ` [PATCH 2/2] iio: light: cm3323: use dev_err_probe() in probe path Aldo Conte
2026-04-02 16:12   ` 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=ac6Vd0YM06tJXzJO@ashevche-desk.local \
    --to=andriy.shevchenko@intel.com \
    --cc=aldocontelk@gmail.com \
    --cc=andy@kernel.org \
    --cc=daniel.baluta@intel.com \
    --cc=dlechner@baylibre.com \
    --cc=jic23@kernel.org \
    --cc=ktsai@capellamicro.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel-mentees@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=me@brighamcampbell.com \
    --cc=nuno.sa@analog.com \
    --cc=skhan@linuxfoundation.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