On Thu, Mar 26, 2020 at 12:15:22PM +0100, Geert Uytterhoeven wrote: > On Thu, Mar 26, 2020 at 11:52 AM Wolfram Sang <wsa@xxxxxxxxxxxxx> wrote: > > > > +{ > > > > + int ret; > > > > + > > > > + ret = device_property_read_u32(dev, prop_name, cur_val_p); > > > > + if (ret && use_def) > > > > + *cur_val_p = def_val; > > > > > > Alternatively, you could just preinitialize the value with the default value > > > before calling this function, and ignoring ret. > > > That would remove the need for both the def_val and use_def parameters. > > > > I can't do that because if !use_def and ret, then the value must not be > > changed. > > Of course the preinitialization must still be done conditionally: > > if (use_defaults) > t->foo = DEFAULT_FOO; > i2c_parse_timing(dev, "foo-name", &t->foo); If the default *is* coming from timings structure? Care to look at rcar case? -- With Best Regards, Andy Shevchenko