On Thu, Aug 29, 2024 at 03:10:22PM +0300, Andy Shevchenko wrote: > On Wed, Aug 28, 2024 at 10:51:22PM +0200, Vasileios Amoiridis wrote: > > The BM(P/E)28x devices have an option for soft reset which is also > > recommended by the Bosch Sensortech BME2 Sensor API to be used before the > > initial configuration of the device. > > ... > > > +static int bmp280_preinit(struct bmp280_data *data) > > +{ > > With > > struct device *dev = data->dev; > > it will look better? > Yes, that could be used. > > + unsigned int reg; > > + int ret; > > > + ret = regmap_write(data->regmap, BMP280_REG_RESET, BMP280_RST_SOFT_CMD); > > + if (ret) > > > + return dev_err_probe(data->dev, ret, > > + "Failed to reset device.\n"); > > return dev_err_probe(dev, ret, "Failed to reset device.\n"); > ACK. > > + /* > > + * According to the datasheet in Chapter 1: Specification, Table 2, > > + * after resetting, the device uses the complete power-on sequence so > > + * it needs to wait for the defined start-up time. > > + */ > > + fsleep(data->start_up_time); > > + > > + ret = regmap_read(data->regmap, BMP280_REG_STATUS, ®); > > + if (ret) > > > + return dev_err_probe(data->dev, ret, > > + "Failed to read status register.\n"); > > return dev_err_probe(dev, ret, "Failed to read status register.\n"); > ACK. > > + if (reg & BMP280_REG_STATUS_IM_UPDATE) > > > + return dev_err_probe(data->dev, -EIO, > > + "Failed to copy NVM contents.\n"); > > return dev_err_probe(dev, -EIO, "Failed to copy NVM contents.\n"); > ACK. > > + return 0; > > +} > > Yes, it's up to 84 characters long, but I think it improves readability. > In all the previous cases though, shouldn't checkpatch.pl generate errors? I didn't notice that they were below 80 chars and I never checked more because checkpatch.pl didn't say anything... > -- > With Best Regards, > Andy Shevchenko > >