There are no problems without patch, but code" while ((mcp251x_read_reg(spi, CANSTAT) & CANCTRL_REQOP_MASK) != CANCTRL_REQOP_CONF) " is hard to undestend, because REQOP bits present in CANCTRL, but no CANSTAT register (In CANSTAT present OPMOD bits (see page 53 MCP2510 datasheet)). We maybe need change name CANCTRL_REQOP_MASK and to CANCTRL_OPMOD_MASK and CANCTRL_REQOP_CONF to CANCTRL_OPMOD_CONF or apply my patch. Without patch code is good by work, but not is good by reading.
2010/7/15 Marc Kleine-Budde <[email protected]> > Hello Andew, > > (adding Christian to CC) > > Andrew Pushkin wrote: > > Signed-off-by: Andrew Pushkin <[email protected]> > > --- > > drivers/net/can/mcp251x.c | 2 +- > > 1 files changed, 1 insertions(+), 1 deletions(-) > > > > diff --git a/drivers/net/can/mcp251x.c b/drivers/net/can/mcp251x.c > > index b11a0cb..53ffec0 100644 > > --- a/drivers/net/can/mcp251x.c > > +++ b/drivers/net/can/mcp251x.c > > @@ -587,7 +587,7 @@ static int mcp251x_hw_reset(struct spi_device *spi) > > /* Wait for reset to finish */ > > timeout = jiffies + HZ; > > mdelay(10); > > - while ((mcp251x_read_reg(spi, CANSTAT) & CANCTRL_REQOP_MASK) > > + while ((mcp251x_read_reg(spi, CANCTRL) & CANCTRL_REQOP_MASK) > > != CANCTRL_REQOP_CONF) { > > schedule(); > > if (time_after(jiffies, timeout)) { > > Andrew, do you have any problem with the unpatched driver? Which problem > does the patch solve? > > cheers, Marc > > -- > Pengutronix e.K. | Marc Kleine-Budde | > Industrial Linux Solutions | Phone: +49-231-2826-924 | > Vertretung West/Dortmund | Fax: +49-5121-206917-5555 | > Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de | > > -- Andrew Pushkin ----------------------------------------------------------- Promwad Innovation Company 22, Olshevskogo St. Office 809 220073, Minsk, Belarus Phone/Fax: +375 (17) 312-1246 E-mail: [email protected] Skype: andrewpushkin Web: www.promwad.com
_______________________________________________ Socketcan-core mailing list [email protected] https://lists.berlios.de/mailman/listinfo/socketcan-core
