Messages in this thread | | | From | Peter Korsgaard <> | Subject | Re: [PATCH 2/3] mcp23s08: isolate spi specific parts | Date | Fri, 15 Jul 2011 08:57:24 +0200 |
| |
>>>>> "Grant" == Grant Likely <grant.likely@secretlab.ca> writes:
Grant> On Thu, Jul 14, 2011 at 09:59:27PM +0200, Peter Korsgaard wrote: >> Change spi member of struct mcp23s08 to be a ops-specific opaque data >> pointer, and move spi specific knowledge out of mcp23s08_probe_one(). >> >> No functional change, but is needed to add i2c support. >> >> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk> >> --- >> drivers/gpio/mcp23s08.c | 75 ++++++++++++++++++++++++++++++++-------------- >> static int __init mcp23s08_init(void) >> { >> - return spi_register_driver(&mcp23s08_driver); >> + int ret = 0;
Grant> '= 0' is redundant.
Will fix.
>> + >> +#ifdef CONFIG_SPI_MASTER >> + ret = spi_register_driver(&mcp23s08_driver); >> + if (ret) >> + return ret; >> +#endif /* CONFIG_SPI_MASTER */ >> + >> + return ret;
Grant> This change really belongs in the 3rd patch that adds the i2c Grant> registration.
You can argue for both ways. With my approach the 3rd patch doesn't touch any of the spi stuff, but OK - I'll change.
-- Bye, Peter Korsgaard
| |