diff options
Diffstat (limited to 'drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c')
-rw-r--r-- | drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c b/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c index e9f01de51e18..54a5402a9079 100644 --- a/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c +++ b/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c @@ -449,7 +449,7 @@ static struct pinctrl_desc pm8xxx_pinctrl_desc = { static int pm8xxx_mpp_direction_input(struct gpio_chip *chip, unsigned offset) { - struct pm8xxx_mpp *pctrl = container_of(chip, struct pm8xxx_mpp, chip); + struct pm8xxx_mpp *pctrl = gpiochip_get_data(chip); struct pm8xxx_pin_data *pin = pctrl->desc.pins[offset].drv_data; switch (pin->mode) { @@ -473,7 +473,7 @@ static int pm8xxx_mpp_direction_output(struct gpio_chip *chip, unsigned offset, int value) { - struct pm8xxx_mpp *pctrl = container_of(chip, struct pm8xxx_mpp, chip); + struct pm8xxx_mpp *pctrl = gpiochip_get_data(chip); struct pm8xxx_pin_data *pin = pctrl->desc.pins[offset].drv_data; switch (pin->mode) { @@ -497,13 +497,13 @@ static int pm8xxx_mpp_direction_output(struct gpio_chip *chip, static int pm8xxx_mpp_get(struct gpio_chip *chip, unsigned offset) { - struct pm8xxx_mpp *pctrl = container_of(chip, struct pm8xxx_mpp, chip); + struct pm8xxx_mpp *pctrl = gpiochip_get_data(chip); struct pm8xxx_pin_data *pin = pctrl->desc.pins[offset].drv_data; bool state; int ret; if (!pin->input) - return pin->output_value; + return !!pin->output_value; ret = irq_get_irqchip_state(pin->irq, IRQCHIP_STATE_LINE_LEVEL, &state); if (!ret) @@ -514,7 +514,7 @@ static int pm8xxx_mpp_get(struct gpio_chip *chip, unsigned offset) static void pm8xxx_mpp_set(struct gpio_chip *chip, unsigned offset, int value) { - struct pm8xxx_mpp *pctrl = container_of(chip, struct pm8xxx_mpp, chip); + struct pm8xxx_mpp *pctrl = gpiochip_get_data(chip); struct pm8xxx_pin_data *pin = pctrl->desc.pins[offset].drv_data; pin->output_value = !!value; @@ -538,7 +538,7 @@ static int pm8xxx_mpp_of_xlate(struct gpio_chip *chip, static int pm8xxx_mpp_to_irq(struct gpio_chip *chip, unsigned offset) { - struct pm8xxx_mpp *pctrl = container_of(chip, struct pm8xxx_mpp, chip); + struct pm8xxx_mpp *pctrl = gpiochip_get_data(chip); struct pm8xxx_pin_data *pin = pctrl->desc.pins[offset].drv_data; return pin->irq; @@ -553,7 +553,7 @@ static void pm8xxx_mpp_dbg_show_one(struct seq_file *s, unsigned offset, unsigned gpio) { - struct pm8xxx_mpp *pctrl = container_of(chip, struct pm8xxx_mpp, chip); + struct pm8xxx_mpp *pctrl = gpiochip_get_data(chip); struct pm8xxx_pin_data *pin = pctrl->desc.pins[offset].drv_data; static const char * const aout_lvls[] = { @@ -828,12 +828,12 @@ static int pm8xxx_mpp_probe(struct platform_device *pdev) pctrl->chip = pm8xxx_mpp_template; pctrl->chip.base = -1; - pctrl->chip.dev = &pdev->dev; + pctrl->chip.parent = &pdev->dev; pctrl->chip.of_node = pdev->dev.of_node; pctrl->chip.of_gpio_n_cells = 2; pctrl->chip.label = dev_name(pctrl->dev); pctrl->chip.ngpio = pctrl->npins; - ret = gpiochip_add(&pctrl->chip); + ret = gpiochip_add_data(&pctrl->chip, pctrl); if (ret) { dev_err(&pdev->dev, "failed register gpiochip\n"); goto unregister_pinctrl; |