public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usb: dwc3: qcom: simplify error check in dwc3_qcom_find_num_ports()
@ 2026-02-18 11:01 Zeeshan Ahmad
  2026-02-19 22:55 ` Thinh Nguyen
  0 siblings, 1 reply; 12+ messages in thread
From: Zeeshan Ahmad @ 2026-02-18 11:01 UTC (permalink / raw)
  To: Thinh Nguyen, Greg Kroah-Hartman
  Cc: linux-usb, kernel-janitors, linux-kernel, Zeeshan Ahmad

The platform_get_irq_byname_optional() function returns a non-zero
IRQ number on success and a negative error code on failure. It
never returns zero.

The current implementation checks for a return value less than or
equal to zero. Since zero is not a valid return value, simplify
the check to only look for negative error codes.

Signed-off-by: Zeeshan Ahmad <zeeshanahmad022019@gmail.com>
---
 drivers/usb/dwc3/dwc3-qcom-legacy.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/dwc3/dwc3-qcom-legacy.c b/drivers/usb/dwc3/dwc3-qcom-legacy.c
index d3fad0fcfdac..34c578309802 100644
--- a/drivers/usb/dwc3/dwc3-qcom-legacy.c
+++ b/drivers/usb/dwc3/dwc3-qcom-legacy.c
@@ -620,14 +620,14 @@ static int dwc3_qcom_find_num_ports(struct platform_device *pdev)
 	int irq;
 
 	irq = platform_get_irq_byname_optional(pdev, "dp_hs_phy_1");
-	if (irq <= 0)
+	if (irq < 0)
 		return 1;
 
 	for (port_num = 2; port_num <= DWC3_QCOM_MAX_PORTS; port_num++) {
 		sprintf(irq_name, "dp_hs_phy_%d", port_num);
 
 		irq = platform_get_irq_byname_optional(pdev, irq_name);
-		if (irq <= 0)
+		if (irq < 0)
 			return port_num - 1;
 	}
 
-- 
2.43.0


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

* Re: [PATCH] usb: dwc3: qcom: simplify error check in dwc3_qcom_find_num_ports()
  2026-02-18 11:01 [PATCH] usb: dwc3: qcom: simplify error check in dwc3_qcom_find_num_ports() Zeeshan Ahmad
@ 2026-02-19 22:55 ` Thinh Nguyen
  2026-02-20  8:15   ` Dan Carpenter
  0 siblings, 1 reply; 12+ messages in thread
From: Thinh Nguyen @ 2026-02-19 22:55 UTC (permalink / raw)
  To: Zeeshan Ahmad
  Cc: Thinh Nguyen, Greg Kroah-Hartman, linux-usb@vger.kernel.org,
	kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org

On Wed, Feb 18, 2026, Zeeshan Ahmad wrote:
> The platform_get_irq_byname_optional() function returns a non-zero
> IRQ number on success and a negative error code on failure. It
> never returns zero.
> 
> The current implementation checks for a return value less than or
> equal to zero. Since zero is not a valid return value, simplify
> the check to only look for negative error codes.
> 
> Signed-off-by: Zeeshan Ahmad <zeeshanahmad022019@gmail.com>
> ---
>  drivers/usb/dwc3/dwc3-qcom-legacy.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/dwc3/dwc3-qcom-legacy.c b/drivers/usb/dwc3/dwc3-qcom-legacy.c
> index d3fad0fcfdac..34c578309802 100644
> --- a/drivers/usb/dwc3/dwc3-qcom-legacy.c
> +++ b/drivers/usb/dwc3/dwc3-qcom-legacy.c
> @@ -620,14 +620,14 @@ static int dwc3_qcom_find_num_ports(struct platform_device *pdev)
>  	int irq;
>  
>  	irq = platform_get_irq_byname_optional(pdev, "dp_hs_phy_1");
> -	if (irq <= 0)
> +	if (irq < 0)
>  		return 1;
>  
>  	for (port_num = 2; port_num <= DWC3_QCOM_MAX_PORTS; port_num++) {
>  		sprintf(irq_name, "dp_hs_phy_%d", port_num);
>  
>  		irq = platform_get_irq_byname_optional(pdev, irq_name);
> -		if (irq <= 0)
> +		if (irq < 0)
>  			return port_num - 1;
>  	}
>  
> -- 
> 2.43.0
> 

Since this is not a fix, I prefer new development to be on the dwc3-qcom
and not the dwc3-qcom-legacy glue.

Thanks,
Thinh

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

* Re: [PATCH] usb: dwc3: qcom: simplify error check in dwc3_qcom_find_num_ports()
  2026-02-19 22:55 ` Thinh Nguyen
@ 2026-02-20  8:15   ` Dan Carpenter
  2026-02-21 10:41     ` Zeeshan Ahmad
  2026-02-24  0:41     ` Thinh Nguyen
  0 siblings, 2 replies; 12+ messages in thread
From: Dan Carpenter @ 2026-02-20  8:15 UTC (permalink / raw)
  To: Thinh Nguyen
  Cc: Zeeshan Ahmad, Greg Kroah-Hartman, linux-usb@vger.kernel.org,
	kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org

On Thu, Feb 19, 2026 at 10:55:29PM +0000, Thinh Nguyen wrote:
> On Wed, Feb 18, 2026, Zeeshan Ahmad wrote:
> > diff --git a/drivers/usb/dwc3/dwc3-qcom-legacy.c b/drivers/usb/dwc3/dwc3-qcom-legacy.c
> > index d3fad0fcfdac..34c578309802 100644
> > --- a/drivers/usb/dwc3/dwc3-qcom-legacy.c
> > +++ b/drivers/usb/dwc3/dwc3-qcom-legacy.c
> > @@ -620,14 +620,14 @@ static int dwc3_qcom_find_num_ports(struct platform_device *pdev)
> >  	int irq;
> >  
> >  	irq = platform_get_irq_byname_optional(pdev, "dp_hs_phy_1");
> > -	if (irq <= 0)
> > +	if (irq < 0)
> >  		return 1;
> >  
> >  	for (port_num = 2; port_num <= DWC3_QCOM_MAX_PORTS; port_num++) {
> >  		sprintf(irq_name, "dp_hs_phy_%d", port_num);
> >  
> >  		irq = platform_get_irq_byname_optional(pdev, irq_name);
> > -		if (irq <= 0)
> > +		if (irq < 0)
> >  			return port_num - 1;
> >  	}
> >  
> > -- 
> > 2.43.0
> > 
> 
> Since this is not a fix, I prefer new development to be on the dwc3-qcom
> and not the dwc3-qcom-legacy glue.

There might be some static checker warnings for these?  Smatch only
warns if people do an explicit zero check since
platform_get_irq_byname_optional() can never return zero.

regards,
dan carpenter


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

* Re: [PATCH] usb: dwc3: qcom: simplify error check in dwc3_qcom_find_num_ports()
  2026-02-20  8:15   ` Dan Carpenter
@ 2026-02-21 10:41     ` Zeeshan Ahmad
  2026-02-24  0:41     ` Thinh Nguyen
  1 sibling, 0 replies; 12+ messages in thread
From: Zeeshan Ahmad @ 2026-02-21 10:41 UTC (permalink / raw)
  To: Dan Carpenter, Thinh Nguyen
  Cc: Greg Kroah-Hartman, linux-usb, kernel-janitors, linux-kernel,
	Zeeshan Ahmad

Hi Dan,

You are correct. I ran Smatch on dwc3-qcom-legacy.c and it did not produce 
a warning for these lines. I identified this issue through a manual grep 
search for the pattern 'platform_get_irq.* <= 0' across the drivers 
directory.

It appears there are several dozen instances of this pattern that Smatch 
currently misses because the '<= 0' check includes a valid negative 
error check alongside the redundant zero check.

Thank you for the technical background on why Smatch handles it this way.

Regards,
Zeeshan

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

* Re: [PATCH] usb: dwc3: qcom: simplify error check in dwc3_qcom_find_num_ports()
  2026-02-20  8:15   ` Dan Carpenter
  2026-02-21 10:41     ` Zeeshan Ahmad
@ 2026-02-24  0:41     ` Thinh Nguyen
  2026-02-24  6:44       ` Zeeshan Ahmad
  1 sibling, 1 reply; 12+ messages in thread
From: Thinh Nguyen @ 2026-02-24  0:41 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Thinh Nguyen, Zeeshan Ahmad, Greg Kroah-Hartman,
	linux-usb@vger.kernel.org, kernel-janitors@vger.kernel.org,
	linux-kernel@vger.kernel.org

On Fri, Feb 20, 2026, Dan Carpenter wrote:
> On Thu, Feb 19, 2026 at 10:55:29PM +0000, Thinh Nguyen wrote:
> > On Wed, Feb 18, 2026, Zeeshan Ahmad wrote:
> > > diff --git a/drivers/usb/dwc3/dwc3-qcom-legacy.c b/drivers/usb/dwc3/dwc3-qcom-legacy.c
> > > index d3fad0fcfdac..34c578309802 100644
> > > --- a/drivers/usb/dwc3/dwc3-qcom-legacy.c
> > > +++ b/drivers/usb/dwc3/dwc3-qcom-legacy.c
> > > @@ -620,14 +620,14 @@ static int dwc3_qcom_find_num_ports(struct platform_device *pdev)
> > >  	int irq;
> > >  
> > >  	irq = platform_get_irq_byname_optional(pdev, "dp_hs_phy_1");
> > > -	if (irq <= 0)
> > > +	if (irq < 0)
> > >  		return 1;
> > >  
> > >  	for (port_num = 2; port_num <= DWC3_QCOM_MAX_PORTS; port_num++) {
> > >  		sprintf(irq_name, "dp_hs_phy_%d", port_num);
> > >  
> > >  		irq = platform_get_irq_byname_optional(pdev, irq_name);
> > > -		if (irq <= 0)
> > > +		if (irq < 0)
> > >  			return port_num - 1;
> > >  	}
> > >  
> > > -- 
> > > 2.43.0
> > > 
> > 
> > Since this is not a fix, I prefer new development to be on the dwc3-qcom
> > and not the dwc3-qcom-legacy glue.
> 
> There might be some static checker warnings for these?  Smatch only
> warns if people do an explicit zero check since
> platform_get_irq_byname_optional() can never return zero.
> 

But that aside, since this is new development rather than a fix, I'd
prefer to see it go into dwc3-qcom instead of the legacy driver. We
should be pushing new features to the main driver to keep things
consolidated and encourage people to migrate away from the legacy code.

BR,
Thinh

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

* Re: [PATCH] usb: dwc3: qcom: simplify error check in dwc3_qcom_find_num_ports()
  2026-02-24  0:41     ` Thinh Nguyen
@ 2026-02-24  6:44       ` Zeeshan Ahmad
  2026-02-25  0:10         ` Thinh Nguyen
  0 siblings, 1 reply; 12+ messages in thread
From: Zeeshan Ahmad @ 2026-02-24  6:44 UTC (permalink / raw)
  To: Thinh Nguyen, Greg Kroah-Hartman
  Cc: Dan Carpenter, linux-usb, kernel-janitors, linux-kernel,
	Zeeshan Ahmad

Hi Thinh,

Thank you for the suggestion. I have audited the modern 
drivers/usb/dwc3/dwc3-qcom.c driver on the latest usb-next branch 
and confirmed that it contains the same redundant IRQ error checks.

I will drop the previous patch for the legacy driver and submit a 
new patch targeting the main dwc3-qcom driver shortly.

Regards,
Zeeshan

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

* [PATCH] usb: dwc3: qcom: simplify error check in dwc3_qcom_find_num_ports()
@ 2026-02-24  7:32 Zeeshan Ahmad
  2026-02-25  0:06 ` Thinh Nguyen
  0 siblings, 1 reply; 12+ messages in thread
From: Zeeshan Ahmad @ 2026-02-24  7:32 UTC (permalink / raw)
  To: Thinh Nguyen, Greg Kroah-Hartman
  Cc: Dan Carpenter, linux-usb, kernel-janitors, linux-kernel,
	Zeeshan Ahmad

The platform_get_irq_byname_optional() function returns a non-zero
IRQ number on success and a negative error code on failure. It
never returns zero.

The current implementation in the modern dwc3-qcom driver checks for
a return value less than or equal to zero. Since zero is not a
valid return value, simplify the check to only look for negative
error codes. This aligns the logic with the standard return contract
of the platform IRQ APIs.

Signed-off-by: Zeeshan Ahmad <zeeshanahmad022019@gmail.com>
---
 drivers/usb/dwc3/dwc3-qcom.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c
index 9ac75547820d..f43f73ac36ff 100644
--- a/drivers/usb/dwc3/dwc3-qcom.c
+++ b/drivers/usb/dwc3/dwc3-qcom.c
@@ -526,14 +526,14 @@ static int dwc3_qcom_find_num_ports(struct platform_device *pdev)
 	int irq;
 
 	irq = platform_get_irq_byname_optional(pdev, "dp_hs_phy_1");
-	if (irq <= 0)
+	if (irq < 0)
 		return 1;
 
 	for (port_num = 2; port_num <= DWC3_QCOM_MAX_PORTS; port_num++) {
 		sprintf(irq_name, "dp_hs_phy_%d", port_num);
 
 		irq = platform_get_irq_byname_optional(pdev, irq_name);
-		if (irq <= 0)
+		if (irq < 0)
 			return port_num - 1;
 	}
 
-- 
2.43.0


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

* Re: [PATCH] usb: dwc3: qcom: simplify error check in dwc3_qcom_find_num_ports()
  2026-02-24  7:32 [PATCH] " Zeeshan Ahmad
@ 2026-02-25  0:06 ` Thinh Nguyen
  0 siblings, 0 replies; 12+ messages in thread
From: Thinh Nguyen @ 2026-02-25  0:06 UTC (permalink / raw)
  To: Zeeshan Ahmad
  Cc: Thinh Nguyen, Greg Kroah-Hartman, Dan Carpenter,
	linux-usb@vger.kernel.org, kernel-janitors@vger.kernel.org,
	linux-kernel@vger.kernel.org

On Tue, Feb 24, 2026, Zeeshan Ahmad wrote:
> The platform_get_irq_byname_optional() function returns a non-zero
> IRQ number on success and a negative error code on failure. It
> never returns zero.
> 
> The current implementation in the modern dwc3-qcom driver checks for
> a return value less than or equal to zero. Since zero is not a
> valid return value, simplify the check to only look for negative
> error codes. This aligns the logic with the standard return contract
> of the platform IRQ APIs.
> 
> Signed-off-by: Zeeshan Ahmad <zeeshanahmad022019@gmail.com>
> ---
>  drivers/usb/dwc3/dwc3-qcom.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c
> index 9ac75547820d..f43f73ac36ff 100644
> --- a/drivers/usb/dwc3/dwc3-qcom.c
> +++ b/drivers/usb/dwc3/dwc3-qcom.c
> @@ -526,14 +526,14 @@ static int dwc3_qcom_find_num_ports(struct platform_device *pdev)
>  	int irq;
>  
>  	irq = platform_get_irq_byname_optional(pdev, "dp_hs_phy_1");
> -	if (irq <= 0)
> +	if (irq < 0)
>  		return 1;
>  
>  	for (port_num = 2; port_num <= DWC3_QCOM_MAX_PORTS; port_num++) {
>  		sprintf(irq_name, "dp_hs_phy_%d", port_num);
>  
>  		irq = platform_get_irq_byname_optional(pdev, irq_name);
> -		if (irq <= 0)
> +		if (irq < 0)
>  			return port_num - 1;
>  	}
>  
> -- 
> 2.43.0
> 

You're using the same $subject as your previous patch. This may cause
some confusion. Can you send V2 with a comment on what's updated?

Thanks,
Thinh

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

* Re: [PATCH] usb: dwc3: qcom: simplify error check in dwc3_qcom_find_num_ports()
  2026-02-24  6:44       ` Zeeshan Ahmad
@ 2026-02-25  0:10         ` Thinh Nguyen
  2026-02-25  6:42           ` [PATCH v2] " Zeeshan Ahmad
  0 siblings, 1 reply; 12+ messages in thread
From: Thinh Nguyen @ 2026-02-25  0:10 UTC (permalink / raw)
  To: Zeeshan Ahmad
  Cc: Thinh Nguyen, Greg Kroah-Hartman, Dan Carpenter,
	linux-usb@vger.kernel.org, kernel-janitors@vger.kernel.org,
	linux-kernel@vger.kernel.org

On Tue, Feb 24, 2026, Zeeshan Ahmad wrote:
> Hi Thinh,
> 
> Thank you for the suggestion. I have audited the modern 
> drivers/usb/dwc3/dwc3-qcom.c driver on the latest usb-next branch 
> and confirmed that it contains the same redundant IRQ error checks.
> 
> I will drop the previous patch for the legacy driver and submit a 
> new patch targeting the main dwc3-qcom driver shortly.
> 

Hi Zeeshan,

Sure. Could you also keep some relevant context from the previous email
thread in your reply? This will help us follow the conversation more
easily.

Thanks,
Thinh

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

* [PATCH v2] usb: dwc3: qcom: simplify error check in dwc3_qcom_find_num_ports()
  2026-02-25  0:10         ` Thinh Nguyen
@ 2026-02-25  6:42           ` Zeeshan Ahmad
  2026-02-25  6:51             ` [PATCH v3] " Zeeshan Ahmad
  0 siblings, 1 reply; 12+ messages in thread
From: Zeeshan Ahmad @ 2026-02-25  6:42 UTC (permalink / raw)
  To: Thinh Nguyen, Greg Kroah-Hartman
  Cc: Dan Carpenter, linux-usb, kernel-janitors, linux-kernel,
	Zeeshan Ahmad

The platform_get_irq_byname_optional() function returns a non-zero
IRQ number on success and a negative error code on failure. It
never returns zero.

The current implementation in the modern dwc3-qcom driver checks for
a return value less than or equal to zero. Since zero is not a
valid return value, simplify the check to only look for negative
error codes. This aligns the logic with the standard return contract
of the platform IRQ APIs.

Signed-off-by: Zeeshan Ahmad <zeeshanahmad022019@gmail.com>
---
 drivers/usb/dwc3/dwc3-qcom.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c
index 9ac75547820d..f43f73ac36ff 100644
--- a/drivers/usb/dwc3/dwc3-qcom.c
+++ b/drivers/usb/dwc3/dwc3-qcom.c
@@ -526,14 +526,14 @@ static int dwc3_qcom_find_num_ports(struct platform_device *pdev)
 	int irq;
 
 	irq = platform_get_irq_byname_optional(pdev, "dp_hs_phy_1");
-	if (irq <= 0)
+	if (irq < 0)
 		return 1;
 
 	for (port_num = 2; port_num <= DWC3_QCOM_MAX_PORTS; port_num++) {
 		sprintf(irq_name, "dp_hs_phy_%d", port_num);
 
 		irq = platform_get_irq_byname_optional(pdev, irq_name);
-		if (irq <= 0)
+		if (irq < 0)
 			return port_num - 1;
 	}
 
-- 
2.43.0


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

* [PATCH v3] usb: dwc3: qcom: simplify error check in dwc3_qcom_find_num_ports()
  2026-02-25  6:42           ` [PATCH v2] " Zeeshan Ahmad
@ 2026-02-25  6:51             ` Zeeshan Ahmad
  2026-02-26  2:14               ` Thinh Nguyen
  0 siblings, 1 reply; 12+ messages in thread
From: Zeeshan Ahmad @ 2026-02-25  6:51 UTC (permalink / raw)
  To: Thinh Nguyen, Greg Kroah-Hartman
  Cc: Dan Carpenter, linux-usb, kernel-janitors, linux-kernel,
	Zeeshan Ahmad

The platform_get_irq_byname_optional() function returns a non-zero
IRQ number on success and a negative error code on failure. It
never returns zero.

The current implementation in the modern dwc3-qcom driver checks for
a return value less than or equal to zero. Since zero is not a
valid return value, simplify the check to only look for negative
error codes. This aligns the logic with the standard return contract
of the platform IRQ APIs.

Signed-off-by: Zeeshan Ahmad <zeeshanahmad022019@gmail.com>
---
v3:
 - Fix missing version changelog in the v2 submission.
v2:
 - Targeted the modern dwc3-qcom.c driver instead of the legacy one 
   as suggested by Thinh Nguyen.
 - Audited the modern driver to confirm the same redundant error 
   check exists there.
 - Updated the commit message to specifically mention the modern 
   dwc3-qcom driver.

 drivers/usb/dwc3/dwc3-qcom.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c
index 9ac75547820d..f43f73ac36ff 100644
--- a/drivers/usb/dwc3/dwc3-qcom.c
+++ b/drivers/usb/dwc3/dwc3-qcom.c
@@ -526,14 +526,14 @@ static int dwc3_qcom_find_num_ports(struct platform_device *pdev)
 	int irq;
 
 	irq = platform_get_irq_byname_optional(pdev, "dp_hs_phy_1");
-	if (irq <= 0)
+	if (irq < 0)
 		return 1;
 
 	for (port_num = 2; port_num <= DWC3_QCOM_MAX_PORTS; port_num++) {
 		sprintf(irq_name, "dp_hs_phy_%d", port_num);
 
 		irq = platform_get_irq_byname_optional(pdev, irq_name);
-		if (irq <= 0)
+		if (irq < 0)
 			return port_num - 1;
 	}
 
-- 
2.43.0


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

* Re: [PATCH v3] usb: dwc3: qcom: simplify error check in dwc3_qcom_find_num_ports()
  2026-02-25  6:51             ` [PATCH v3] " Zeeshan Ahmad
@ 2026-02-26  2:14               ` Thinh Nguyen
  0 siblings, 0 replies; 12+ messages in thread
From: Thinh Nguyen @ 2026-02-26  2:14 UTC (permalink / raw)
  To: Zeeshan Ahmad
  Cc: Thinh Nguyen, Greg Kroah-Hartman, Dan Carpenter,
	linux-usb@vger.kernel.org, kernel-janitors@vger.kernel.org,
	linux-kernel@vger.kernel.org

On Wed, Feb 25, 2026, Zeeshan Ahmad wrote:
> The platform_get_irq_byname_optional() function returns a non-zero
> IRQ number on success and a negative error code on failure. It
> never returns zero.
> 
> The current implementation in the modern dwc3-qcom driver checks for
> a return value less than or equal to zero. Since zero is not a
> valid return value, simplify the check to only look for negative
> error codes. This aligns the logic with the standard return contract
> of the platform IRQ APIs.
> 
> Signed-off-by: Zeeshan Ahmad <zeeshanahmad022019@gmail.com>
> ---
> v3:
>  - Fix missing version changelog in the v2 submission.
> v2:
>  - Targeted the modern dwc3-qcom.c driver instead of the legacy one 
>    as suggested by Thinh Nguyen.
>  - Audited the modern driver to confirm the same redundant error 
>    check exists there.
>  - Updated the commit message to specifically mention the modern 
>    dwc3-qcom driver.
> 
>  drivers/usb/dwc3/dwc3-qcom.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c
> index 9ac75547820d..f43f73ac36ff 100644
> --- a/drivers/usb/dwc3/dwc3-qcom.c
> +++ b/drivers/usb/dwc3/dwc3-qcom.c
> @@ -526,14 +526,14 @@ static int dwc3_qcom_find_num_ports(struct platform_device *pdev)
>  	int irq;
>  
>  	irq = platform_get_irq_byname_optional(pdev, "dp_hs_phy_1");
> -	if (irq <= 0)
> +	if (irq < 0)
>  		return 1;
>  
>  	for (port_num = 2; port_num <= DWC3_QCOM_MAX_PORTS; port_num++) {
>  		sprintf(irq_name, "dp_hs_phy_%d", port_num);
>  
>  		irq = platform_get_irq_byname_optional(pdev, irq_name);
> -		if (irq <= 0)
> +		if (irq < 0)
>  			return port_num - 1;
>  	}
>  
> -- 
> 2.43.0
> 

Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>

BR,
Thinh

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

end of thread, other threads:[~2026-02-26  2:14 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-18 11:01 [PATCH] usb: dwc3: qcom: simplify error check in dwc3_qcom_find_num_ports() Zeeshan Ahmad
2026-02-19 22:55 ` Thinh Nguyen
2026-02-20  8:15   ` Dan Carpenter
2026-02-21 10:41     ` Zeeshan Ahmad
2026-02-24  0:41     ` Thinh Nguyen
2026-02-24  6:44       ` Zeeshan Ahmad
2026-02-25  0:10         ` Thinh Nguyen
2026-02-25  6:42           ` [PATCH v2] " Zeeshan Ahmad
2026-02-25  6:51             ` [PATCH v3] " Zeeshan Ahmad
2026-02-26  2:14               ` Thinh Nguyen
  -- strict thread matches above, loose matches on Subject: below --
2026-02-24  7:32 [PATCH] " Zeeshan Ahmad
2026-02-25  0:06 ` Thinh Nguyen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox