Re: [PATCH] pinctrl: tegra: Use of_device_get_match_data()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Sep 23, 2019 at 11:36:37AM +0200, Thierry Reding wrote:
> From: Thierry Reding <treding@xxxxxxxxxx>
> 
> Use the of_device_get_match_data() helper instead of open-coding.
> 
> Signed-off-by: Thierry Reding <treding@xxxxxxxxxx>
> ---
>  drivers/pinctrl/tegra/pinctrl-tegra-xusb.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)

Actually, scratch that. We can't do this because the match table is
different for the legacy case from what the new PHY driver uses which
calls this only for the legacy case. Instead, I'd propose the attached
patch.

Thierry

--- >8 ---
From 6c96f18a2608b21d178007c97337400b788c3f9e Mon Sep 17 00:00:00 2001
From: Thierry Reding <treding@xxxxxxxxxx>
Date: Mon, 23 Sep 2019 11:47:25 +0200
Subject: [PATCH] pinctrl: tegra: xusb: Add note about legacy status

Add a comment about why the call to of_match_node() cannot be replaced
by of_device_get_match_data(). This will hopefully prevent people from
attempting to clean this up in the future.

Signed-off-by: Thierry Reding <treding@xxxxxxxxxx>
---
 drivers/pinctrl/tegra/pinctrl-tegra-xusb.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/pinctrl/tegra/pinctrl-tegra-xusb.c b/drivers/pinctrl/tegra/pinctrl-tegra-xusb.c
index 95002e3ecaff..f2fa1f76ebb7 100644
--- a/drivers/pinctrl/tegra/pinctrl-tegra-xusb.c
+++ b/drivers/pinctrl/tegra/pinctrl-tegra-xusb.c
@@ -885,6 +885,12 @@ int tegra_xusb_padctl_legacy_probe(struct platform_device *pdev)
 	mutex_init(&padctl->lock);
 	padctl->dev = &pdev->dev;
 
+	/*
+	 * Note that we can't replace this by of_device_get_match_data()
+	 * because we need the separate matching table for this legacy code on
+	 * Tegra124. of_device_get_match_data() would attempt to use the table
+	 * from the updated driver and fail.
+	 */
 	match = of_match_node(tegra_xusb_padctl_of_match, pdev->dev.of_node);
 	padctl->soc = match->data;
 
-- 
2.23.0

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [ARM Kernel]     [Linux ARM]     [Linux ARM MSM]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux