[PATCH] i2c-tools: don't include linux/i2c-dev.h

Denys Vlasenko vda.linux at googlemail.com
Tue Aug 29 10:32:09 UTC 2017


Applied, thanks!

On Mon, Aug 28, 2017 at 4:55 PM, Bartosz Golaszewski
<bartekgola at gmail.com> wrote:
> Installing headers from upstream i2c-tools makes it impossible to
> build the busybox version due to redefined symbols. This is caused by
> the fact that linux/i2c-dev.h from i2c-tools overwrites the one from
> linux uapi and defines symbols already defined by linux' linux/i2c.h.
>
> Drop this include and simply re-implement the relevant defines from
> linux/i2c-dev.h in miscutils/i2c-tools.c.
>
> Tested by building on systems with and without i2c-tools headers.
>
> Signed-off-by: Bartosz Golaszewski <bartekgola at gmail.com>
> ---
>  miscutils/i2c_tools.c | 14 +++++++++++++-
>  1 file changed, 13 insertions(+), 1 deletion(-)
>
> diff --git a/miscutils/i2c_tools.c b/miscutils/i2c_tools.c
> index 03a09d519..6c21fbe43 100644
> --- a/miscutils/i2c_tools.c
> +++ b/miscutils/i2c_tools.c
> @@ -63,7 +63,6 @@
>  #include "libbb.h"
>
>  #include <linux/i2c.h>
> -#include <linux/i2c-dev.h>
>
>  #define I2CDUMP_NUM_REGS               256
>
> @@ -71,6 +70,19 @@
>  #define I2CDETECT_MODE_QUICK           1
>  #define I2CDETECT_MODE_READ            2
>
> +#define I2C_SLAVE                      0x0703
> +#define I2C_SLAVE_FORCE                        0x0706
> +#define I2C_FUNCS                      0x0705
> +#define I2C_PEC                                0x0708
> +#define I2C_SMBUS                      0x0720
> +
> +struct i2c_smbus_ioctl_data {
> +       __u8 read_write;
> +       __u8 command;
> +       __u32 size;
> +       union i2c_smbus_data *data;
> +};
> +
>  /*
>   * This is needed for ioctl_or_perror_and_die() since it only accepts pointers.
>   */
> --
> 2.13.2
>


More information about the busybox mailing list