[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190701160311.GB30468@lunn.ch>
Date: Mon, 1 Jul 2019 18:03:11 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Pawel Dembicki <paweldembicki@...il.com>
Cc: linus.walleij@...aro.org,
Vivien Didelot <vivien.didelot@...il.com>,
Florian Fainelli <f.fainelli@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Rob Herring <robh+dt@...nel.org>,
Mark Rutland <mark.rutland@....com>, netdev@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/4] net: dsa: vsc73xx: Split vsc73xx driver
> @@ -495,12 +380,12 @@ static int vsc73xx_update_bits(struct vsc73xx *vsc, u8 block, u8 subblock,
> int ret;
>
> /* Same read-modify-write algorithm as e.g. regmap */
> - ret = vsc73xx_read(vsc, block, subblock, reg, &orig);
> + ret = vsc->ops->read(vsc, block, subblock, reg, &orig);
> if (ret)
> return ret;
> tmp = orig & ~mask;
> tmp |= val & mask;
> - return vsc73xx_write(vsc, block, subblock, reg, tmp);
> + return vsc->ops->write(vsc, block, subblock, reg, tmp);
This patch would be a lot less invasive and smaller if you hid the
difference between SPI and platform inside vsc73xx_write() and
vsc73xx_read().
> -static int vsc73xx_probe(struct spi_device *spi)
> +int vsc73xx_probe(struct vsc73xx *vsc)
> {
> - struct device *dev = &spi->dev;
struct device *dev = vsc->dev;
and then a lot of the changes you make here go away.
In general, think about how to make the changes small. It saves your
time from actually making changes, and reviewer time since the patch
it smaller.
Andrew
Powered by blists - more mailing lists