linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] usb: dwc3: qcom: Remove useless compatible strings from the match table
@ 2019-12-12 21:21 Douglas Anderson
  2019-12-12 23:23 ` Bjorn Andersson
  2019-12-13  7:07 ` Manu Gautam
  0 siblings, 2 replies; 3+ messages in thread
From: Douglas Anderson @ 2019-12-12 21:21 UTC (permalink / raw)
  To: Felipe Balbi
  Cc: Bjorn Andersson, Manu Gautam, Andy Gross, Sandeep Maheswaram,
	Jeffrey Hugo, Douglas Anderson, linux-arm-msm, linux-usb,
	linux-kernel, Greg Kroah-Hartman

The of match table in dwc3-qcom.c had an entry per Qualcomm SoC known
to have dwc3.  That's not needed.  Here's why:

1. The bindings specify that the compatible string in the device tree
   should contain the SoC-specific compatible string followed by the
   string "qcom,dwc3".

2. All known Qualcomm SoC dts files (confirmed via git grep in
   mainline Linux) using dwc3 follow the rules and do, in fact,
   contain the SoC-specific compatible string followed by the string
   "qcom,dwc3".

3. The source code does nothing special with the per-SoC strings--they
   are only used to match the node.

Let's remove the extra strings from the table.  Doing so will avoid
the need to land future useless patches [1] that do nothing more than
add yet more strings to the table.

NOTE: if later we _do_ find some SoC-specific quirk we need to handle
in the code we can add back a subset of these strings.  At the time we
will probably also add some data in the match table to make it easier
to generalize this hypothetical quirk across all the SoCs it affects.

[1] https://lore.kernel.org/r/1574940787-1004-2-git-send-email-sanm@codeaurora.org

Signed-off-by: Douglas Anderson <dianders@chromium.org>
---

 drivers/usb/dwc3/dwc3-qcom.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c
index 261af9e38ddd..72e867e02a1c 100644
--- a/drivers/usb/dwc3/dwc3-qcom.c
+++ b/drivers/usb/dwc3/dwc3-qcom.c
@@ -751,9 +751,6 @@ static const struct dev_pm_ops dwc3_qcom_dev_pm_ops = {
 
 static const struct of_device_id dwc3_qcom_of_match[] = {
 	{ .compatible = "qcom,dwc3" },
-	{ .compatible = "qcom,msm8996-dwc3" },
-	{ .compatible = "qcom,msm8998-dwc3" },
-	{ .compatible = "qcom,sdm845-dwc3" },
 	{ }
 };
 MODULE_DEVICE_TABLE(of, dwc3_qcom_of_match);
-- 
2.24.1.735.g03f4e72817-goog


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] usb: dwc3: qcom: Remove useless compatible strings from the match table
  2019-12-12 21:21 [PATCH] usb: dwc3: qcom: Remove useless compatible strings from the match table Douglas Anderson
@ 2019-12-12 23:23 ` Bjorn Andersson
  2019-12-13  7:07 ` Manu Gautam
  1 sibling, 0 replies; 3+ messages in thread
From: Bjorn Andersson @ 2019-12-12 23:23 UTC (permalink / raw)
  To: Douglas Anderson
  Cc: Felipe Balbi, Manu Gautam, Andy Gross, Sandeep Maheswaram,
	Jeffrey Hugo, linux-arm-msm, linux-usb, linux-kernel,
	Greg Kroah-Hartman

On Thu 12 Dec 13:21 PST 2019, Douglas Anderson wrote:

> The of match table in dwc3-qcom.c had an entry per Qualcomm SoC known
> to have dwc3.  That's not needed.  Here's why:
> 
> 1. The bindings specify that the compatible string in the device tree
>    should contain the SoC-specific compatible string followed by the
>    string "qcom,dwc3".
> 
> 2. All known Qualcomm SoC dts files (confirmed via git grep in
>    mainline Linux) using dwc3 follow the rules and do, in fact,
>    contain the SoC-specific compatible string followed by the string
>    "qcom,dwc3".
> 
> 3. The source code does nothing special with the per-SoC strings--they
>    are only used to match the node.
> 
> Let's remove the extra strings from the table.  Doing so will avoid
> the need to land future useless patches [1] that do nothing more than
> add yet more strings to the table.
> 
> NOTE: if later we _do_ find some SoC-specific quirk we need to handle
> in the code we can add back a subset of these strings.  At the time we
> will probably also add some data in the match table to make it easier
> to generalize this hypothetical quirk across all the SoCs it affects.
> 
> [1] https://lore.kernel.org/r/1574940787-1004-2-git-send-email-sanm@codeaurora.org
> 

Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>

> Signed-off-by: Douglas Anderson <dianders@chromium.org>
> ---
> 
>  drivers/usb/dwc3/dwc3-qcom.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c
> index 261af9e38ddd..72e867e02a1c 100644
> --- a/drivers/usb/dwc3/dwc3-qcom.c
> +++ b/drivers/usb/dwc3/dwc3-qcom.c
> @@ -751,9 +751,6 @@ static const struct dev_pm_ops dwc3_qcom_dev_pm_ops = {
>  
>  static const struct of_device_id dwc3_qcom_of_match[] = {
>  	{ .compatible = "qcom,dwc3" },
> -	{ .compatible = "qcom,msm8996-dwc3" },
> -	{ .compatible = "qcom,msm8998-dwc3" },
> -	{ .compatible = "qcom,sdm845-dwc3" },
>  	{ }
>  };
>  MODULE_DEVICE_TABLE(of, dwc3_qcom_of_match);
> -- 
> 2.24.1.735.g03f4e72817-goog
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] usb: dwc3: qcom: Remove useless compatible strings from the match table
  2019-12-12 21:21 [PATCH] usb: dwc3: qcom: Remove useless compatible strings from the match table Douglas Anderson
  2019-12-12 23:23 ` Bjorn Andersson
@ 2019-12-13  7:07 ` Manu Gautam
  1 sibling, 0 replies; 3+ messages in thread
From: Manu Gautam @ 2019-12-13  7:07 UTC (permalink / raw)
  To: Douglas Anderson, Felipe Balbi
  Cc: Bjorn Andersson, Andy Gross, Sandeep Maheswaram, Jeffrey Hugo,
	linux-arm-msm, linux-usb, linux-kernel, Greg Kroah-Hartman

Thanks. Patch looks good to me.

On 12/13/2019 2:51 AM, Douglas Anderson wrote:
> The of match table in dwc3-qcom.c had an entry per Qualcomm SoC known
> to have dwc3.  That's not needed.  Here's why:
>
> 1. The bindings specify that the compatible string in the device tree
>    should contain the SoC-specific compatible string followed by the
>    string "qcom,dwc3".
>
> 2. All known Qualcomm SoC dts files (confirmed via git grep in
>    mainline Linux) using dwc3 follow the rules and do, in fact,
>    contain the SoC-specific compatible string followed by the string
>    "qcom,dwc3".
>
> 3. The source code does nothing special with the per-SoC strings--they
>    are only used to match the node.
>
> Let's remove the extra strings from the table.  Doing so will avoid
> the need to land future useless patches [1] that do nothing more than
> add yet more strings to the table.

Reviewed-by: Manu Gautam <mgautam@codeaurora.org>

-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-12-13  7:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-12 21:21 [PATCH] usb: dwc3: qcom: Remove useless compatible strings from the match table Douglas Anderson
2019-12-12 23:23 ` Bjorn Andersson
2019-12-13  7:07 ` Manu Gautam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).