All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingyu Jang <ingyujang25@unist.ac.kr>
To: gregkh@linuxfoundation.org
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	ysjeon@unist.ac.kr
Subject: [PATCH] Remove redundant check for usb_generic_driver_probe()
Date: Fri, 26 Jan 2024 21:03:13 +0900	[thread overview]
Message-ID: <20240126120313.1362573-1-ingyujang25@unist.ac.kr> (raw)

usb_generic_driver_probe() only returns 0.
Inside this function, there are only errors that are marked as not fatal.
However, drivers/usb/core/driver.c:269 checks
if usb_generic_driver_probe() returns error.
No need to change usb_generic_driver_probe() to return error,
only remove redundant error check.

Signed-off-by: Ingyu Jang <ingyujang25@unist.ac.kr>
---
 drivers/usb/core/driver.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c
index e01b1913d02b..b6274580b7ca 100644
--- a/drivers/usb/core/driver.c
+++ b/drivers/usb/core/driver.c
@@ -266,8 +266,6 @@ static int usb_probe_device(struct device *dev)
 
 	if (udriver->generic_subclass)
 		error = usb_generic_driver_probe(udev);
-	if (error)
-		return error;
 
 	/* Probe the USB device with the driver in hand, but only
 	 * defer to a generic driver in case the current USB
-- 
2.34.1


             reply	other threads:[~2024-01-26 12:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-26 12:03 Ingyu Jang [this message]
2024-01-26 14:29 ` [PATCH] Remove redundant check for usb_generic_driver_probe() Alan Stern

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240126120313.1362573-1-ingyujang25@unist.ac.kr \
    --to=ingyujang25@unist.ac.kr \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=ysjeon@unist.ac.kr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.