Hi Florian, On Fri, 3 May 2019 16:01:38 -0700, Florian Fainelli <f.faine...@gmail.com> wrote:
> [snip] > > > assert_reg_lock(chip); > > > > - err = mv88e6xxx_smi_read(chip, addr, reg, val); > > + if (chip->smi_ops) > > + err = chip->smi_ops->read(chip, addr, reg, val); > > + else > > You might want to check for smi_ops && smi_ops->read here to be safe. > You could also keep that code unchanged, and just make > mv88e6xxx_smi_read() an inline helper within smi.h: > > static inline int mv88e6xxx_smi_read(struct mv88e6xxx_chip *chip, int > addr, int reg, int *val) > { > if (chip->smi_ops && chip->smi_ops->read) > return chip->smi_ops->read(chip, addr, reg, val); > > return -EOPNOTSUPP; > } I've written it that way to simplify the check for an alternative mv88e6xxx_bus_ops pointer implemented in a future patch, but your approach is simpler, let's make it inline for the moment. I'll respin a v2 right away with the subject prefix this time ;-) Thanks, Vivien