On Tue, Jul 16, 2024 at 04:00:45PM -0700, Guenter Roeck wrote: > Use multi-byte regmap operations where possible to reduce code size > and the need for mutex protection. > > No functional change. > > Signed-off-by: Guenter Roeck <linux@xxxxxxxxxxxx> Reviewed-by: Tzung-Bi Shih <tzungbi@xxxxxxxxxx> > @@ -181,92 +181,77 @@ static int lm95245_read_temp(struct device *dev, u32 attr, int channel, [...] > - ret = regmap_read(regmap, LM95245_REG_R_REMOTE_TEMPL_U, > - ®vall); > - if (ret < 0) > + ret = regmap_bulk_read(regmap, LM95245_REG_R_REMOTE_TEMPH_U, regvals, 2); > + if (ret) > return ret; > - ret = regmap_read(regmap, LM95245_REG_R_REMOTE_TEMPH_U, > - ®valh); > - if (ret < 0) > - return ret; > - *val = temp_from_reg_unsigned(regvalh, regvall); > + *val = temp_from_reg_unsigned(regvals[0], regvals[1]); Just a note: I took a while for realizing that a regmap_bulk_read() is sufficient here as LM95245_REG_R_REMOTE_TEMPH_U and LM95245_REG_R_REMOTE_TEMPL_U are continuous. The same logic applies to the rest changes.