[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210426122540.xzanhcel7gv4dfsh@pengutronix.de>
Date: Mon, 26 Apr 2021 14:25:40 +0200
From: Oleksij Rempel <o.rempel@...gutronix.de>
To: Andrew Lunn <andrew@...n.ch>
Cc: Woojung Huh <woojung.huh@...rochip.com>,
UNGLinuxDriver@...rochip.com,
Florian Fainelli <f.fainelli@...il.com>,
Vivien Didelot <vivien.didelot@...il.com>,
Vladimir Oltean <olteanv@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Michael Grzeschik <m.grzeschik@...gutronix.de>,
kernel@...gutronix.de, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, Russell King <linux@...linux.org.uk>
Subject: Re: [PATCH net-next v6 08/10] net: dsa: microchip: Add Microchip
KSZ8863 SMI based driver support
On Sat, Apr 24, 2021 at 06:01:05PM +0200, Andrew Lunn wrote:
> > +static int ksz8863_mdio_read(void *ctx, const void *reg_buf, size_t reg_len,
> > + void *val_buf, size_t val_len)
> > +{
> > + struct ksz_device *dev = ctx;
> > + struct ksz8 *ksz8 = dev->priv;
> > + struct mdio_device *mdev = ksz8->priv;
> > + u8 reg = *(u8 *)reg_buf;
> > + u8 *val = val_buf;
> > + int ret = 0;
> > + int i;
>
> ...
>
>
> > +
> > + mutex_lock_nested(&mdev->bus->mdio_lock, MDIO_MUTEX_NESTED);
> > + for (i = 0; i < val_len; i++) {
> > + int tmp = reg + i;
> > +
> > + ret = __mdiobus_read(mdev->bus, ((tmp & 0xE0) >> 5) |
> > + SMI_KSZ88XX_READ_PHY, tmp);
> > + if (ret < 0)
> > + goto out;
> > +
> > + val[i] = ret;
> > + }
> > + ret = 0;
> > +
> > + out:
> > + mutex_unlock(&mdev->bus->mdio_lock);
> > +
> > + return ret;
> > +}
> > +
> > +static int ksz8863_mdio_write(void *ctx, const void *data, size_t count)
> > +{
> > + struct ksz_device *dev = ctx;
> > + struct ksz8 *ksz8 = dev->priv;
> > + struct mdio_device *mdev = ksz8->priv;
> > + u8 *val = (u8 *)(data + 4);
> > + u32 reg = *(u32 *)data;
> > + int ret = 0;
> > + int i;
>
> ...
>
>
> > +static const struct of_device_id ksz8863_dt_ids[] = {
> > + { .compatible = "microchip,ksz8863" },
> > + { .compatible = "microchip,ksz8873" },
> > + { },
> > +};
>
> Is there code somewhere which verifies that what has been found really
> does match what is in device tree? We don't want errors in the device
> tree to be ignored.
>
> Andrew
Hm, it makes sense. But it is not regression of this patches, is it OK
to mainline it separately?
Regards,
Oleksij
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
Powered by blists - more mailing lists