On Tue, Sep 3, 2024 at 10:11 AM Lorenzo Bianconi <lorenzo@xxxxxxxxxx> wrote: ... > > struct device *dev = hw->dev; > > + const struct st_sensors_platform_data *pdata = dev_get_platdata(dev); > > nit: I guess you can move pdata pointer in the 'if' block, since it is just > used there. Yes, but it will increase the LoCs number by 3 for no benefit for each of such cases. > > int err = 0, drdy_pin; > > > > - if (device_property_read_u32(dev, "st,drdy-int-pin", &drdy_pin) < 0) { > > - struct st_sensors_platform_data *pdata; > > - > > - pdata = (struct st_sensors_platform_data *)dev->platform_data; > > + if (device_property_read_u32(dev, "st,drdy-int-pin", &drdy_pin) < 0) > > drdy_pin = pdata ? pdata->drdy_int_pin : 1; > > - } -- With Best Regards, Andy Shevchenko