Re: [PATCH] hwmon-ntc_thermistor: Delete an unnecessary check before the function call "iio_channel_release"

From: Guenter Roeck
Date: Mon Jul 18 2016 - 23:36:12 EST


On 07/18/2016 11:54 AM, SF Markus Elfring wrote:
From: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 18 Jul 2016 20:34:41 +0200

The iio_channel_release() function tests whether its argument is NULL
and then returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>

A much better change would be to use devm_iio_channel_get() instead of
iio_channel_get(), and to remove ntc_iio_channel_release() completely.

Guenter