Skip to content

Commit

Permalink
gpio-mcp23s08: Build I2C support even when CONFIG_I2C=m
Browse files Browse the repository at this point in the history
The driver has both SPI and I2C pieces. The appropriate pieces are built based
on whether SPI and/or I2C is/are enabled. However, it was only checking if I2C
was built-in, never if it was built as a module. This patch checks for either
since building both this driver and I2C as modules is possible.

Signed-off-by: Daniel M. Weeks <dan@danweeks.net>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
  • Loading branch information
Daniel M. Weeks authored and Linus Walleij committed Nov 17, 2012
1 parent cb144fe commit cbf24fa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/gpio/gpio-mcp23s08.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ struct mcp23s08_driver_data {

/*----------------------------------------------------------------------*/

#ifdef CONFIG_I2C
#if IS_ENABLED(CONFIG_I2C)

static int mcp23008_read(struct mcp23s08 *mcp, unsigned reg)
{
Expand Down Expand Up @@ -399,7 +399,7 @@ static int mcp23s08_probe_one(struct mcp23s08 *mcp, struct device *dev,
break;
#endif /* CONFIG_SPI_MASTER */

#ifdef CONFIG_I2C
#if IS_ENABLED(CONFIG_I2C)
case MCP_TYPE_008:
mcp->ops = &mcp23008_ops;
mcp->chip.ngpio = 8;
Expand Down Expand Up @@ -473,7 +473,7 @@ static int mcp23s08_probe_one(struct mcp23s08 *mcp, struct device *dev,

/*----------------------------------------------------------------------*/

#ifdef CONFIG_I2C
#if IS_ENABLED(CONFIG_I2C)

static int __devinit mcp230xx_probe(struct i2c_client *client,
const struct i2c_device_id *id)
Expand Down

0 comments on commit cbf24fa

Please sign in to comment.