[PATCH linux dev-5.15] iio: si7020: Remove reset in probe

Joel Stanley joel at jms.id.au
Wed May 25 11:29:07 AEST 2022


On Wed, 25 May 2022 at 01:11, Eddie James <eajames at linux.ibm.com> wrote:
>
> I2C commands issued after the SI7020 is starting up or after reset
> can potentially upset the startup sequence. Therefore, the host
> needs to wait for the startup sequence to finish before issuing
> further i2c commands. This is impractical in cases where the SI7020
> is on a shared bus or behind a mux, which may switch channels at
> any time (generating I2C traffic). Therefore, remove the device
> reset in the probe function.
>
> Signed-off-by: Eddie James <eajames at linux.ibm.com>
> ---
>  drivers/iio/humidity/si7020.c | 7 -------
>  1 file changed, 7 deletions(-)
>
> diff --git a/drivers/iio/humidity/si7020.c b/drivers/iio/humidity/si7020.c
> index ab6537f136ba..3c55b81ce984 100644
> --- a/drivers/iio/humidity/si7020.c
> +++ b/drivers/iio/humidity/si7020.c
> @@ -115,13 +115,6 @@ static int si7020_probe(struct i2c_client *client,
>                                      I2C_FUNC_SMBUS_READ_WORD_DATA))
>                 return -EOPNOTSUPP;
>
> -       /* Reset device, loads default settings. */
> -       ret = i2c_smbus_write_byte(client, SI7020CMD_RESET);
> -       if (ret < 0)
> -               return ret;
> -       /* Wait the maximum power-up time after software reset. */
> -       msleep(15);


../drivers/iio/humidity/si7020.c:111:13: warning: unused variable
‘ret’ [-Wunused-variable]
  111 |         int ret;
      |             ^~~

I have fixed it up when applying, but keep that in mind for when you
send upstream.
> -
>         indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*data));
>         if (!indio_dev)
>                 return -ENOMEM;
> --
> 2.27.0
>


More information about the openbmc mailing list