RE: Question about i2c_xxx function on CONFIG_I2C

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, I think you can config the kernel using make menuconfig command, go to Device Driver--->I2C Suppport

Check what you want to disselect. 


-----Original Message-----
From: linux-i2c-owner@xxxxxxxxxxxxxxx [mailto:linux-i2c-owner@xxxxxxxxxxxxxxx] On Behalf Of kuninori.morimoto.gx@xxxxxxxxxxx
Sent: Monday, June 27, 2011 3:00 PM
To: Linux-I2C
Subject: Question about i2c_xxx function on CONFIG_I2C


Dear all

I'm using i2c_xxx function on some board.
And sometimes I need very small kernel which doesn't need CONFIG_I2C.

But then (.config doesn't have CONFIG_I2C), the compile will fail.
like this

error: implicit declaration of function 'i2c_get_adapter'
error: implicit declaration of function 'i2c_transfer'

In this case, should I use #ifdef CONFIG_I2C in my code to solve this compile issue ?
Or is below #else in i2c.h good idea ?

--- i2c.h ---------
#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
...
extern struct i2c_adapter *i2c_get_adapter(int nr);
...
#else
...
#define i2c_get_adapter(nr) NULL
...
#endif


Best regards
---
Kuninori Morimoto
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux