static void spics_set_value(struct gpio_chip *chip, unsigned offset, int value)
{
- struct spear_spics *spics = container_of(chip, struct spear_spics,
- chip);
+ struct spear_spics *spics = gpiochip_get_data(chip);
u32 tmp;
/* select chip select from register */
static int spics_request(struct gpio_chip *chip, unsigned offset)
{
- struct spear_spics *spics = container_of(chip, struct spear_spics,
- chip);
+ struct spear_spics *spics = gpiochip_get_data(chip);
u32 tmp;
if (!spics->use_count++) {
static void spics_free(struct gpio_chip *chip, unsigned offset)
{
- struct spear_spics *spics = container_of(chip, struct spear_spics,
- chip);
+ struct spear_spics *spics = gpiochip_get_data(chip);
u32 tmp;
if (!--spics->use_count) {
spics->chip.owner = THIS_MODULE;
spics->last_off = -1;
- ret = gpiochip_add(&spics->chip);
+ ret = gpiochip_add_data(&spics->chip, spics);
if (ret) {
dev_err(&pdev->dev, "unable to add gpio chip\n");
return ret;