|
@@ -245,7 +245,7 @@ static void pca9532_led_work(struct work_struct *work)
|
|
#ifdef CONFIG_LEDS_PCA9532_GPIO
|
|
#ifdef CONFIG_LEDS_PCA9532_GPIO
|
|
static int pca9532_gpio_request_pin(struct gpio_chip *gc, unsigned offset)
|
|
static int pca9532_gpio_request_pin(struct gpio_chip *gc, unsigned offset)
|
|
{
|
|
{
|
|
- struct pca9532_data *data = container_of(gc, struct pca9532_data, gpio);
|
|
|
|
|
|
+ struct pca9532_data *data = gpiochip_get_data(gc);
|
|
struct pca9532_led *led = &data->leds[offset];
|
|
struct pca9532_led *led = &data->leds[offset];
|
|
|
|
|
|
if (led->type == PCA9532_TYPE_GPIO)
|
|
if (led->type == PCA9532_TYPE_GPIO)
|
|
@@ -256,7 +256,7 @@ static int pca9532_gpio_request_pin(struct gpio_chip *gc, unsigned offset)
|
|
|
|
|
|
static void pca9532_gpio_set_value(struct gpio_chip *gc, unsigned offset, int val)
|
|
static void pca9532_gpio_set_value(struct gpio_chip *gc, unsigned offset, int val)
|
|
{
|
|
{
|
|
- struct pca9532_data *data = container_of(gc, struct pca9532_data, gpio);
|
|
|
|
|
|
+ struct pca9532_data *data = gpiochip_get_data(gc);
|
|
struct pca9532_led *led = &data->leds[offset];
|
|
struct pca9532_led *led = &data->leds[offset];
|
|
|
|
|
|
if (val)
|
|
if (val)
|
|
@@ -269,7 +269,7 @@ static void pca9532_gpio_set_value(struct gpio_chip *gc, unsigned offset, int va
|
|
|
|
|
|
static int pca9532_gpio_get_value(struct gpio_chip *gc, unsigned offset)
|
|
static int pca9532_gpio_get_value(struct gpio_chip *gc, unsigned offset)
|
|
{
|
|
{
|
|
- struct pca9532_data *data = container_of(gc, struct pca9532_data, gpio);
|
|
|
|
|
|
+ struct pca9532_data *data = gpiochip_get_data(gc);
|
|
unsigned char reg;
|
|
unsigned char reg;
|
|
|
|
|
|
reg = i2c_smbus_read_byte_data(data->client, PCA9532_REG_INPUT(offset));
|
|
reg = i2c_smbus_read_byte_data(data->client, PCA9532_REG_INPUT(offset));
|
|
@@ -416,7 +416,7 @@ static int pca9532_configure(struct i2c_client *client,
|
|
data->gpio.parent = &client->dev;
|
|
data->gpio.parent = &client->dev;
|
|
data->gpio.owner = THIS_MODULE;
|
|
data->gpio.owner = THIS_MODULE;
|
|
|
|
|
|
- err = gpiochip_add(&data->gpio);
|
|
|
|
|
|
+ err = gpiochip_add_data(&data->gpio, data);
|
|
if (err) {
|
|
if (err) {
|
|
/* Use data->gpio.dev as a flag for freeing gpiochip */
|
|
/* Use data->gpio.dev as a flag for freeing gpiochip */
|
|
data->gpio.parent = NULL;
|
|
data->gpio.parent = NULL;
|