Lines Matching refs:ret

95 	int ret;  in hp206c_read_20bit()  local
98 ret = i2c_smbus_read_i2c_block_data(client, cmd, sizeof(values), values); in hp206c_read_20bit()
99 if (ret < 0) in hp206c_read_20bit()
100 return ret; in hp206c_read_20bit()
101 if (ret != sizeof(values)) in hp206c_read_20bit()
109 int ret; in hp206c_wait_dev_rdy() local
115 ret = hp206c_read_reg(client, HP206C_REG_INT_SRC); in hp206c_wait_dev_rdy()
116 if (ret < 0) { in hp206c_wait_dev_rdy()
117 dev_err(&indio_dev->dev, "Failed READ_REG INT_SRC: %d\n", ret); in hp206c_wait_dev_rdy()
118 return ret; in hp206c_wait_dev_rdy()
120 if (ret & HP206C_FLAG_DEV_RDY) in hp206c_wait_dev_rdy()
145 int ret; in hp206c_soft_reset() local
149 ret = i2c_smbus_write_byte(client, HP206C_CMD_SOFT_RST); in hp206c_soft_reset()
150 if (ret) { in hp206c_soft_reset()
151 dev_err(&client->dev, "Failed to reset device: %d\n", ret); in hp206c_soft_reset()
152 return ret; in hp206c_soft_reset()
157 ret = hp206c_wait_dev_rdy(indio_dev); in hp206c_soft_reset()
158 if (ret) { in hp206c_soft_reset()
159 dev_err(&client->dev, "Device not ready after soft reset: %d\n", ret); in hp206c_soft_reset()
160 return ret; in hp206c_soft_reset()
163 ret = hp206c_set_compensation(client, true); in hp206c_soft_reset()
164 if (ret) in hp206c_soft_reset()
165 dev_err(&client->dev, "Failed to enable compensation: %d\n", ret); in hp206c_soft_reset()
166 return ret; in hp206c_soft_reset()
173 int ret; in hp206c_conv_and_read() local
177 ret = hp206c_wait_dev_rdy(indio_dev); in hp206c_conv_and_read()
178 if (ret < 0) { in hp206c_conv_and_read()
179 dev_err(&indio_dev->dev, "Device not ready: %d\n", ret); in hp206c_conv_and_read()
180 return ret; in hp206c_conv_and_read()
183 ret = i2c_smbus_write_byte(client, conv_cmd); in hp206c_conv_and_read()
184 if (ret < 0) { in hp206c_conv_and_read()
185 dev_err(&indio_dev->dev, "Failed convert: %d\n", ret); in hp206c_conv_and_read()
186 return ret; in hp206c_conv_and_read()
191 ret = hp206c_wait_dev_rdy(indio_dev); in hp206c_conv_and_read()
192 if (ret < 0) { in hp206c_conv_and_read()
193 dev_err(&indio_dev->dev, "Device not ready: %d\n", ret); in hp206c_conv_and_read()
194 return ret; in hp206c_conv_and_read()
197 ret = hp206c_read_20bit(client, read_cmd); in hp206c_conv_and_read()
198 if (ret < 0) in hp206c_conv_and_read()
199 dev_err(&indio_dev->dev, "Failed read: %d\n", ret); in hp206c_conv_and_read()
201 return ret; in hp206c_conv_and_read()
208 int ret; in hp206c_read_raw() local
220 ret = IIO_VAL_INT; in hp206c_read_raw()
225 ret = IIO_VAL_INT; in hp206c_read_raw()
228 ret = -EINVAL; in hp206c_read_raw()
239 ret = hp206c_conv_and_read(indio_dev, in hp206c_read_raw()
243 if (ret >= 0) { in hp206c_read_raw()
247 *val = sign_extend32(ret, 19); in hp206c_read_raw()
248 ret = IIO_VAL_INT; in hp206c_read_raw()
257 ret = hp206c_conv_and_read(indio_dev, in hp206c_read_raw()
261 if (ret >= 0) { in hp206c_read_raw()
262 *val = ret; in hp206c_read_raw()
263 ret = IIO_VAL_INT; in hp206c_read_raw()
267 ret = -EINVAL; in hp206c_read_raw()
276 ret = IIO_VAL_INT_PLUS_MICRO; in hp206c_read_raw()
282 ret = IIO_VAL_INT_PLUS_MICRO; in hp206c_read_raw()
285 ret = -EINVAL; in hp206c_read_raw()
290 ret = -EINVAL; in hp206c_read_raw()
294 return ret; in hp206c_read_raw()
301 int ret = 0; in hp206c_write_raw() local
317 ret = -EINVAL; in hp206c_write_raw()
320 return ret; in hp206c_write_raw()
360 int ret; in hp206c_probe() local
388 ret = hp206c_soft_reset(indio_dev); in hp206c_probe()
389 if (ret) { in hp206c_probe()
390 dev_err(&client->dev, "Failed to reset on startup: %d\n", ret); in hp206c_probe()