Re: [PATCH 2/3] mcp23s08: isolate spi specific parts

From: Peter Korsgaard
Date: Fri Jul 15 2011 - 02:57:40 EST


>>>>> "Grant" == Grant Likely <grant.likely@xxxxxxxxxxxx> 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@xxxxxxxxxx>
>> ---
>> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/