lkml.org 
[lkml]   [2012]   [Nov]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] gpio-mcp23s08: Build I2C support even when CONFIG_I2C=m
From
On Fri, Nov 2, 2012 at 1:09 AM, Daniel M. Weeks <dan@danweeks.net> wrote:

> 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.

Good catch!

> -#ifdef CONFIG_I2C
> +#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)

But don't do it like this, there are already helpers for exactly this.

Do:

#if IS_ENABLED(CONFIG_I2C)

Read include/linux/kconfig.h if in doubt...

Looking forward to v2!

Yours,
Linus Walleij


\
 
 \ /
  Last update: 2012-11-04 20:01    [W:0.029 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site