Re: [PATCH 4/5] iio: humidity: hts221: use dev_err_probe() in probe paths

Andy Shevchenko <[email protected]>
Newsgroups dev.linux.lists.linux-kernel-mentees,org.kernel.vger.linux-iio,org.kernel.vger.linux-kernel
Organization Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs, Bertel Jungin Aukio 5, 02600 Espoo
Message-ID <[email protected]>
On Sat, Aug 08, 2026 at 05:00:25PM +0800, Adi Nata wrote:
> Convert remaining probe-time error logs to dev_err_probe() so the
> errno is included and deferred probe failures stay quiet.

...

> @@ -579,33 +579,27 @@ int hts221_probe(struct device *dev, int irq, const char *name,

>  	/* configure humidity sensor */
>  	err = hts221_parse_rh_caldata(hw);
> -	if (err < 0) {
> -		dev_err(hw->dev, "failed to get rh calibration data\n");
> -		return err;
> -	}
> +	if (err < 0)
> +		return dev_err_probe(hw->dev, err,
> +				     "failed to get rh calibration data\n");

Why hw->dev and not simply dev?!
Also in all cases.

-- 
With Best Regards,
Andy Shevchenko
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.