[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20190503191421.GB5333@t480s.localdomain>
Date: Fri, 3 May 2019 19:14:21 -0400
From: Vivien Didelot <vivien.didelot@...il.com>
To: Florian Fainelli <f.fainelli@...il.com>
Cc: netdev@...r.kernel.org, "David S. Miller" <davem@...emloft.net>,
Andrew Lunn <andrew@...n.ch>
Subject: Re: [PATCH] net: dsa: mv88e6xxx: refine SMI support
Hi Florian,
On Fri, 3 May 2019 16:01:38 -0700, Florian Fainelli <f.fainelli@...il.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
Powered by blists - more mailing lists