--- zzzz-none-000/linux-4.4.271/drivers/pinctrl/mediatek/pinctrl-mtk-common.c 2021-06-03 06:22:09.000000000 +0000 +++ maple-fsgw-759/linux-4.4.271/drivers/pinctrl/mediatek/pinctrl-mtk-common.c 2023-12-20 10:37:25.000000000 +0000 @@ -95,7 +95,7 @@ { unsigned int reg_addr; unsigned int bit; - struct mtk_pinctrl *pctl = dev_get_drvdata(chip->dev); + struct mtk_pinctrl *pctl = dev_get_drvdata(chip->parent); reg_addr = mtk_get_port(pctl, offset) + pctl->devdata->dout_offset; bit = BIT(offset & 0xf); @@ -742,7 +742,7 @@ unsigned int bit; unsigned int read_val = 0; - struct mtk_pinctrl *pctl = dev_get_drvdata(chip->dev); + struct mtk_pinctrl *pctl = dev_get_drvdata(chip->parent); reg_addr = mtk_get_port(pctl, offset) + pctl->devdata->dir_offset; bit = BIT(offset & 0xf); @@ -755,7 +755,7 @@ unsigned int reg_addr; unsigned int bit; unsigned int read_val = 0; - struct mtk_pinctrl *pctl = dev_get_drvdata(chip->dev); + struct mtk_pinctrl *pctl = dev_get_drvdata(chip->parent); reg_addr = mtk_get_port(pctl, offset) + pctl->devdata->din_offset; @@ -768,7 +768,7 @@ static int mtk_gpio_to_irq(struct gpio_chip *chip, unsigned offset) { const struct mtk_desc_pin *pin; - struct mtk_pinctrl *pctl = dev_get_drvdata(chip->dev); + struct mtk_pinctrl *pctl = dev_get_drvdata(chip->parent); int irq; pin = pctl->devdata->pins + offset; @@ -936,7 +936,7 @@ static int mtk_gpio_set_debounce(struct gpio_chip *chip, unsigned offset, unsigned debounce) { - struct mtk_pinctrl *pctl = dev_get_drvdata(chip->dev); + struct mtk_pinctrl *pctl = dev_get_drvdata(chip->parent); int eint_num, virq, eint_offset; unsigned int set_offset, bit, clr_bit, clr_offset, rst, i, unmask, dbnc; static const unsigned int debounce_time[] = {500, 1000, 16000, 32000, 64000, @@ -1347,7 +1347,7 @@ *pctl->chip = mtk_gpio_chip; pctl->chip->ngpio = pctl->devdata->npins; pctl->chip->label = dev_name(&pdev->dev); - pctl->chip->dev = &pdev->dev; + pctl->chip->parent = &pdev->dev; pctl->chip->base = -1; ret = gpiochip_add(pctl->chip);