error: 'struct gpio_chip' has no member named 'dev'

477 views
Skip to first unread message

malkowki_belgium

unread,
May 12, 2016, 9:14:58 AM5/12/16
to BeagleBoard
Hi ,
I am running the following Kernel on my board:
Linux version 4.5.2-armv7-x2 gcc version 5.3.1 20160113 (Linaro GCC 5.3-2016.02) ) #1 SMP Wed May 11 12:23:19 CEST 2016


I am getting the following error while compiling the kernel version from Robert Nelson for the module PCA9535 as buil-in:
drivers/gpio/gpio-pca953x-pdata.c: In function 'pca953x_setup_gpio':
drivers
/gpio/gpio-pca953x-pdata.c:362:4: error: 'struct gpio_chip' has no member named 'dev'
  gc
->dev = &chip->client->dev;
   
^
make
[2]: *** [drivers/gpio/gpio-pca953x-pdata.o] Error 1
make
[1]: *** [drivers/gpio] Error 2
make
: *** [drivers] Error 2


>> the line of the code is the following:

tatic
void pca953x_setup_gpio(struct pca953x_chip *chip, int gpios)
{
   
struct gpio_chip *gc;

    gc
= &chip->gpio_chip;

    gc
->direction_input  = pca953x_gpio_direction_input;
    gc
->direction_output = pca953x_gpio_direction_output;
    gc
->get = pca953x_gpio_get_value;
    gc
->set = pca953x_gpio_set_value;
    gc
->can_sleep = 1;

    gc
->base = chip->gpio_start;
    gc
->ngpio = gpios;
    gc
->label = chip->client->name;
   
gc->dev = &chip->client->dev;
    gc
->owner = THIS_MODULE;
    gc
->names = chip->names;
}




I am using the code of
/*
 *  PCA953x 4/8/16 bit I/O ports
 *
 *  Copyright (C) 2005 Ben Gardner <bgar...@wabtec.com>
 *  Copyright (C) 2007 Marvell International Ltd.
 *
 *  Derived from drivers/i2c/chips/pca9539.c
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; version 2 of the License.
 */

Does any one knows what could be the problem? I used the same code for the kernel version 4.1.x I didn't get any error.


skip...@gmail.com

unread,
Jun 13, 2016, 4:56:44 PM6/13/16
to BeagleBoard
Same problem
Reply all
Reply to author
Forward
0 new messages