diff mbox series

[04/20] pinctrl/rockchip: switch to use device_get_match_data

Message ID 20220920103108.23074-5-jay.xu@rock-chips.com (mailing list archive)
State New, archived
Headers show
Series Rockchip pinctrl/GPIO support ACPI | expand

Commit Message

Jianqun Xu Sept. 20, 2022, 10:30 a.m. UTC
Switch to use device_get_match_data to get match data.

Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
---
 drivers/pinctrl/pinctrl-rockchip.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

Comments

Linus Walleij Oct. 4, 2022, 7:13 a.m. UTC | #1
On Tue, Sep 20, 2022 at 12:31 PM Jianqun Xu <jay.xu@rock-chips.com> wrote:

> -       match = of_match_node(rockchip_pinctrl_dt_match, node);
> -       ctrl = (struct rockchip_pin_ctrl *)match->data;
> -
> +       ctrl = (struct rockchip_pin_ctrl *)device_get_match_data(dev);

Drop the cast: these pointers are void * and can be assigned to anything.

Yours,
Linus Walleij
diff mbox series

Patch

diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c
index 723b44edc1f2..8f102f327af8 100644
--- a/drivers/pinctrl/pinctrl-rockchip.c
+++ b/drivers/pinctrl/pinctrl-rockchip.c
@@ -3129,16 +3129,11 @@  static struct rockchip_pin_ctrl *rockchip_pinctrl_get_soc_data(
 						struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
-	struct fwnode_handle *fwnode = dev_fwnode(dev);
-	struct device_node *node = to_of_node(fwnode);
-	const struct of_device_id *match;
 	struct rockchip_pin_ctrl *ctrl;
 	struct rockchip_pin_bank *bank;
 	int grf_offs, pmu_offs, drv_grf_offs, drv_pmu_offs, i, j;
 
-	match = of_match_node(rockchip_pinctrl_dt_match, node);
-	ctrl = (struct rockchip_pin_ctrl *)match->data;
-
+	ctrl = (struct rockchip_pin_ctrl *)device_get_match_data(dev);
 	grf_offs = ctrl->grf_mux_offset;
 	pmu_offs = ctrl->pmu_mux_offset;
 	drv_pmu_offs = ctrl->pmu_drv_offset;