Skip to content

Commit a6ff463

Browse files
committed
Merge tag 'pinctrl-v5.6-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl
Pull pin control fixes from Linus Walleij: "Some pin control fixes for the v5.6 series. It comes down to memory leaks in the core and driver fixes. Some should have been sent earlier but they kept piling up and the world is just so full of distractions these days. - Fix some inverted pins in the Meson GLX driver. - Align the i.MX SC message structs causing warnings from KASan. - Balance the kref in pinctrl hogs so they are actually free:d when removing a pin control module. We haven't seen it before as people don't use modules for pin control that much, I think. - Add a missing call to pinctrl_unregister_mappings() another memory leak when using modules. - Fix the fwspec parsing in the Qualcomm driver. - Fix a syntax error in the Falcon driver. - Assign .irq_eoi conditionally in the Qualcomm driver, fixing a bug affecting elder Qualcomm platforms" * tag 'pinctrl-v5.6-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: pinctrl: qcom: Assign irq_eoi conditionally pinctrl: falcon: fix syntax error pinctrl: qcom: ssbi-gpio: Fix fwspec parsing bug pinctrl: madera: Add missing call to pinctrl_unregister_mappings pinctrl: core: Remove extra kref_get which blocks hogs being freed pinctrl: imx: scu: Align imx sc msg structs to 4 pinctrl: meson-gxl: fix GPIOX sdio pins
2 parents e3a36eb + 1cada2f commit a6ff463

File tree

7 files changed

+20
-9
lines changed

7 files changed

+20
-9
lines changed

drivers/pinctrl/cirrus/pinctrl-madera-core.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,13 +1073,26 @@ static int madera_pin_probe(struct platform_device *pdev)
10731073
return ret;
10741074
}
10751075

1076+
platform_set_drvdata(pdev, priv);
1077+
10761078
dev_dbg(priv->dev, "pinctrl probed ok\n");
10771079

10781080
return 0;
10791081
}
10801082

1083+
static int madera_pin_remove(struct platform_device *pdev)
1084+
{
1085+
struct madera_pin_private *priv = platform_get_drvdata(pdev);
1086+
1087+
if (priv->madera->pdata.gpio_configs)
1088+
pinctrl_unregister_mappings(priv->madera->pdata.gpio_configs);
1089+
1090+
return 0;
1091+
}
1092+
10811093
static struct platform_driver madera_pin_driver = {
10821094
.probe = madera_pin_probe,
1095+
.remove = madera_pin_remove,
10831096
.driver = {
10841097
.name = "madera-pinctrl",
10851098
},

drivers/pinctrl/core.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2021,7 +2021,6 @@ static int pinctrl_claim_hogs(struct pinctrl_dev *pctldev)
20212021
return PTR_ERR(pctldev->p);
20222022
}
20232023

2024-
kref_get(&pctldev->p->users);
20252024
pctldev->hog_default =
20262025
pinctrl_lookup_state(pctldev->p, PINCTRL_STATE_DEFAULT);
20272026
if (IS_ERR(pctldev->hog_default)) {

drivers/pinctrl/freescale/pinctrl-scu.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ struct imx_sc_msg_req_pad_set {
2323
struct imx_sc_rpc_msg hdr;
2424
u32 val;
2525
u16 pad;
26-
} __packed;
26+
} __packed __aligned(4);
2727

2828
struct imx_sc_msg_req_pad_get {
2929
struct imx_sc_rpc_msg hdr;
3030
u16 pad;
31-
} __packed;
31+
} __packed __aligned(4);
3232

3333
struct imx_sc_msg_resp_pad_get {
3434
struct imx_sc_rpc_msg hdr;

drivers/pinctrl/meson/pinctrl-meson-gxl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ static const unsigned int sdio_d0_pins[] = { GPIOX_0 };
147147
static const unsigned int sdio_d1_pins[] = { GPIOX_1 };
148148
static const unsigned int sdio_d2_pins[] = { GPIOX_2 };
149149
static const unsigned int sdio_d3_pins[] = { GPIOX_3 };
150-
static const unsigned int sdio_cmd_pins[] = { GPIOX_4 };
151-
static const unsigned int sdio_clk_pins[] = { GPIOX_5 };
150+
static const unsigned int sdio_clk_pins[] = { GPIOX_4 };
151+
static const unsigned int sdio_cmd_pins[] = { GPIOX_5 };
152152
static const unsigned int sdio_irq_pins[] = { GPIOX_7 };
153153

154154
static const unsigned int nand_ce0_pins[] = { BOOT_8 };

drivers/pinctrl/pinctrl-falcon.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ static int pinctrl_falcon_probe(struct platform_device *pdev)
451451
falcon_info.clk[*bank] = clk_get(&ppdev->dev, NULL);
452452
if (IS_ERR(falcon_info.clk[*bank])) {
453453
dev_err(&ppdev->dev, "failed to get clock\n");
454-
of_node_put(np)
454+
of_node_put(np);
455455
return PTR_ERR(falcon_info.clk[*bank]);
456456
}
457457
falcon_info.membase[*bank] = devm_ioremap_resource(&pdev->dev,

drivers/pinctrl/qcom/pinctrl-msm.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1104,7 +1104,6 @@ static int msm_gpio_init(struct msm_pinctrl *pctrl)
11041104
pctrl->irq_chip.irq_mask = msm_gpio_irq_mask;
11051105
pctrl->irq_chip.irq_unmask = msm_gpio_irq_unmask;
11061106
pctrl->irq_chip.irq_ack = msm_gpio_irq_ack;
1107-
pctrl->irq_chip.irq_eoi = irq_chip_eoi_parent;
11081107
pctrl->irq_chip.irq_set_type = msm_gpio_irq_set_type;
11091108
pctrl->irq_chip.irq_set_wake = msm_gpio_irq_set_wake;
11101109
pctrl->irq_chip.irq_request_resources = msm_gpio_irq_reqres;
@@ -1118,7 +1117,7 @@ static int msm_gpio_init(struct msm_pinctrl *pctrl)
11181117
if (!chip->irq.parent_domain)
11191118
return -EPROBE_DEFER;
11201119
chip->irq.child_to_parent_hwirq = msm_gpio_wakeirq;
1121-
1120+
pctrl->irq_chip.irq_eoi = irq_chip_eoi_parent;
11221121
/*
11231122
* Let's skip handling the GPIOs, if the parent irqchip
11241123
* is handling the direct connect IRQ of the GPIO.

drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -794,7 +794,7 @@ static int pm8xxx_gpio_probe(struct platform_device *pdev)
794794
girq->fwnode = of_node_to_fwnode(pctrl->dev->of_node);
795795
girq->parent_domain = parent_domain;
796796
girq->child_to_parent_hwirq = pm8xxx_child_to_parent_hwirq;
797-
girq->populate_parent_alloc_arg = gpiochip_populate_parent_fwspec_fourcell;
797+
girq->populate_parent_alloc_arg = gpiochip_populate_parent_fwspec_twocell;
798798
girq->child_offset_to_irq = pm8xxx_child_offset_to_irq;
799799
girq->child_irq_domain_ops.translate = pm8xxx_domain_translate;
800800

0 commit comments

Comments
 (0)