From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vignesh R Date: Tue, 24 May 2016 09:56:04 +0530 Subject: [U-Boot] [PATCH v5 02/12] spi: davinci_spi: Convert to driver to adapt to DM In-Reply-To: References: <1462360772-27542-3-git-send-email-vigneshr@ti.com> <20160520050110.13518-1-vigneshr@ti.com> Message-ID: <5743D7DC.9010603@ti.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 05/20/2016 08:54 PM, Simon Glass wrote: > Hi Vignesh, > > On 19 May 2016 at 23:01, Vignesh R wrote: >> >> Convert davinci_spi driver so that it complies with SPI DM framework. >> >> Signed-off-by: Vignesh R >> Reviewed-by: Tom Rini >> --- >> >> v5: correct error message. >> >> v4: Check error returned by dev_map_physmem(). >> >> v3: No changes >> >> v2: Add comments to struct davinci_spi_slave members. >> Use dev_map_physmem() added by previous patch. >> >> drivers/spi/davinci_spi.c | 329 +++++++++++++++++++++++++++++++++------------- >> 1 file changed, 240 insertions(+), 89 deletions(-) > > Sorry I missed something below. > [snip] > >> +static int davinci_ofdata_to_platadata(struct udevice *bus) >> +{ >> + struct davinci_spi_slave *ds = dev_get_priv(bus); >> + const void *blob = gd->fdt_blob; >> + int node = bus->of_offset; >> + >> + ds->regs = dev_map_physmem(bus, sizeof(struct davinci_spi_regs)); >> + if (!ds->regs) { >> + printf("%s: could not map device address\n", __func__); >> + return -ENODEV; > > -EINVAL > > We use -ENODEV to say there is no device. Here, we have a device but > the configuration is wrong. Ok, I posted in v6 with above change. -- Regards Vignesh