Re: [PATCH] staging: iio: cdc: ad7746: Fix unnecessary check and assignment in ad7746_probe()

2021-05-18 Thread Dan Carpenter
On Mon, May 17, 2021 at 11:00:06PM +0800, Tang Bin wrote: > @@ -730,11 +730,7 @@ static int ad7746_probe(struct i2c_client *client, > if (ret < 0) > return ret; > > - ret = devm_iio_device_register(indio_dev->dev.parent, indio_dev); > - if (ret) > - return

Re: [PATCH] staging: iio: cdc: ad7746: Fix unnecessary check and assignment in ad7746_probe()

2021-05-17 Thread Marcelo Schmitt
Hi Tang, The patch looks overall good, though I think it could be split into two pieces: one for simplifying ret declaration and another for removing the check after device register. Despite that, I guess Lucas might already be working on similar changes.

[PATCH] staging: iio: cdc: ad7746: Fix unnecessary check and assignment in ad7746_probe()

2021-05-17 Thread Tang Bin
In the function ad7746_probe(), the return value of devm_iio_device_register() can be zero or ret, thus it is unnecessary to repeated check here. And delete unused initialized value of 'ret', because it will be assigned by the function i2c_smbus_write_byte_data(). Signed-off-by: Tang Bin ---