diff options
Diffstat (limited to 'drivers/pinctrl/pinctrl-xway.c')
-rw-r--r-- | drivers/pinctrl/pinctrl-xway.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/pinctrl/pinctrl-xway.c b/drivers/pinctrl/pinctrl-xway.c index 7db7469..412c6b7 100644 --- a/drivers/pinctrl/pinctrl-xway.c +++ b/drivers/pinctrl/pinctrl-xway.c @@ -1535,7 +1535,7 @@ static struct ltq_pinmux_info xway_info = { /* --------- gpio_chip related code --------- */ static void xway_gpio_set(struct gpio_chip *chip, unsigned int pin, int val) { - struct ltq_pinmux_info *info = dev_get_drvdata(chip->dev); + struct ltq_pinmux_info *info = dev_get_drvdata(chip->parent); if (val) gpio_setbit(info->membase[0], GPIO_OUT(pin), PORT_PIN(pin)); @@ -1545,14 +1545,14 @@ static void xway_gpio_set(struct gpio_chip *chip, unsigned int pin, int val) static int xway_gpio_get(struct gpio_chip *chip, unsigned int pin) { - struct ltq_pinmux_info *info = dev_get_drvdata(chip->dev); + struct ltq_pinmux_info *info = dev_get_drvdata(chip->parent); - return gpio_getbit(info->membase[0], GPIO_IN(pin), PORT_PIN(pin)); + return !!gpio_getbit(info->membase[0], GPIO_IN(pin), PORT_PIN(pin)); } static int xway_gpio_dir_in(struct gpio_chip *chip, unsigned int pin) { - struct ltq_pinmux_info *info = dev_get_drvdata(chip->dev); + struct ltq_pinmux_info *info = dev_get_drvdata(chip->parent); gpio_clearbit(info->membase[0], GPIO_DIR(pin), PORT_PIN(pin)); @@ -1561,7 +1561,7 @@ static int xway_gpio_dir_in(struct gpio_chip *chip, unsigned int pin) static int xway_gpio_dir_out(struct gpio_chip *chip, unsigned int pin, int val) { - struct ltq_pinmux_info *info = dev_get_drvdata(chip->dev); + struct ltq_pinmux_info *info = dev_get_drvdata(chip->parent); if (PORT(pin) == PORT3) gpio_setbit(info->membase[0], GPIO3_OD, PORT_PIN(pin)); @@ -1708,7 +1708,7 @@ static int pinmux_xway_probe(struct platform_device *pdev) xway_pctrl_desc.pins = xway_info.pads; /* load the gpio chip */ - xway_chip.dev = &pdev->dev; + xway_chip.parent = &pdev->dev; ret = gpiochip_add(&xway_chip); if (ret) { dev_err(&pdev->dev, "Failed to register gpio chip\n"); |