From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Tue, 22 Sep 2015 02:10:26 +0200 Subject: [U-Boot] [PATCH] spi : convert altera_spi to driver model In-Reply-To: <1442840311-12689-1-git-send-email-thomas@wytron.com.tw> References: <1442840311-12689-1-git-send-email-thomas@wytron.com.tw> Message-ID: <201509220210.26908.marex@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Monday, September 21, 2015 at 02:58:31 PM, Thomas Chou wrote: > Convert altera_spi to driver model > > Signed-off-by: Thomas Chou Hi! > --- > drivers/spi/Kconfig | 8 ++ > drivers/spi/altera_spi.c | 197 > ++++++++++++++++++++++++++--------------------- 2 files changed, 119 > insertions(+), 86 deletions(-) [...] > + > +static int altera_spi_set_speed(struct udevice *bus, uint speed) > +{ > + return 0; > +} > + > +static int altera_spi_set_mode(struct udevice *bus, uint mode) > +{ > + return 0; > +} I suspect you might want to tweak the core code to check if those .set_speed and .set_mode are assigned in dm_spi_ops structure and if not, don't call them. > +static int altera_spi_probe(struct udevice *bus) > +{ > + struct altera_spi_platdata *plat = dev_get_platdata(bus); > + struct altera_spi_priv *priv = dev_get_priv(bus); > + > + priv->regs = plat->regs; > + > + return 0; > +} > + > +static int altera_spi_ofdata_to_platdata(struct udevice *bus) > +{ > + struct altera_spi_platdata *plat = dev_get_platdata(bus); > + > + plat->regs = ioremap(dev_get_addr(bus), > + sizeof(struct altera_spi_regs)); I guess the same thing about ioremap() and ranges applies here? > + return 0; > +} But all these are minor nits, thanks ! [...]