Commit cbf24fad authored by Daniel M. Weeks's avatar Daniel M. Weeks Committed by Linus Walleij

gpio-mcp23s08: Build I2C support even when CONFIG_I2C=m

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: default avatarDaniel M. Weeks <dan@danweeks.net>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent cb144fe8
...@@ -77,7 +77,7 @@ struct mcp23s08_driver_data { ...@@ -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) static int mcp23008_read(struct mcp23s08 *mcp, unsigned reg)
{ {
...@@ -399,7 +399,7 @@ static int mcp23s08_probe_one(struct mcp23s08 *mcp, struct device *dev, ...@@ -399,7 +399,7 @@ static int mcp23s08_probe_one(struct mcp23s08 *mcp, struct device *dev,
break; break;
#endif /* CONFIG_SPI_MASTER */ #endif /* CONFIG_SPI_MASTER */
#ifdef CONFIG_I2C #if IS_ENABLED(CONFIG_I2C)
case MCP_TYPE_008: case MCP_TYPE_008:
mcp->ops = &mcp23008_ops; mcp->ops = &mcp23008_ops;
mcp->chip.ngpio = 8; mcp->chip.ngpio = 8;
...@@ -473,7 +473,7 @@ static int mcp23s08_probe_one(struct mcp23s08 *mcp, struct device *dev, ...@@ -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, static int __devinit mcp230xx_probe(struct i2c_client *client,
const struct i2c_device_id *id) const struct i2c_device_id *id)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment