Message ID | 20231201102946.v2.1.I7ea0dd55ee2acdb48b0e6d28c1a704ab2c29206f@changeid |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp1331995vqy; Fri, 1 Dec 2023 10:32:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IEYv8G9g4quEQnLgS8ZaM4xAEpnjYn84wRZbFv/QqNEOUPifSLB0nS2liu7uvhFfJIDVorM X-Received: by 2002:a17:902:ea05:b0:1cf:d52a:2247 with SMTP id s5-20020a170902ea0500b001cfd52a2247mr23839141plg.13.1701455526002; Fri, 01 Dec 2023 10:32:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701455525; cv=none; d=google.com; s=arc-20160816; b=StPq95xz0OL0Ov+O3xvu8SYlngHo1iTtyhMotOzy1NUeDStElfY1mhwUHAv4bnqHNm i6cSKDKw/KFUKlQUPI92OrpthgazL00R8Y/0h/wGBQm3wwZtW/7gRaJbX+YMv638YJux x/Ip8mL02QznJdCXyNVL8D+eeI5TEjJ55UrAecnHYOvJQzvRn3PMjo5zmRq5o0h+ZjFV lmewv8TYHI15Q/Rt8Lf+lVTqN6qJzStEOPp2fOiZeepZNByt51M4YNozdsxU8ljlvQsA 7WcPfv+svej148RR6h41ew8hqAI+9JCFYrk8vwxipPU0ZY9yxP8MDyXp7JFujZTV8HET n5mQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=V5Q+AM+DhOXR89Ju18vzTGC3wrGXus7g2e66yEQ6u/o=; fh=pnJJeP49VWXD+260X8SBmIMRXj/Czcwqqd/QjqxfLjM=; b=sIZz+up7xyx0wAb/2QL2VjQfpAWTKCw0j6hJL9nqikdGbLNktr738G4VvNnNqzAN1n mPp9jBjcD8d39MPpDvzB17XkX5icpQIYLFmjeZ7L26BU0fKWo/7rntIWdZf2jJk3Br/t wPEY05paP8lIumW7N5AtCGRG2HxjSZIWRVZBG6sKv81K9eYqdUMwYiAia0GtwXrwL642 oVj/SJEgaJd4oFDtNsRY3mk3Pp8V8AYltlDdB78NLATQE5bb0PHTyTzXpaX2qrjB0C8L 7y+JWyaoaE1Akl3g5E8xIEY7++tD7l8tv5JxdBn3Ta/rAQaBPYNbhvXxT6+Xn7GmG7eO NeuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=bqnAI4pb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id z4-20020a170902ee0400b001cc47d6f4absi506819plb.107.2023.12.01.10.32.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 10:32:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=bqnAI4pb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 4E477812D235; Fri, 1 Dec 2023 10:31:48 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379252AbjLASb0 (ORCPT <rfc822;pwkd43@gmail.com> + 99 others); Fri, 1 Dec 2023 13:31:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230364AbjLASbZ (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 1 Dec 2023 13:31:25 -0500 Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26AE312A for <linux-kernel@vger.kernel.org>; Fri, 1 Dec 2023 10:31:31 -0800 (PST) Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-6cbd24d9557so1979018b3a.1 for <linux-kernel@vger.kernel.org>; Fri, 01 Dec 2023 10:31:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1701455490; x=1702060290; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=V5Q+AM+DhOXR89Ju18vzTGC3wrGXus7g2e66yEQ6u/o=; b=bqnAI4pbt/2JXEGzsxEb82qCt80IXSahvoeovzNLUMK3RKJ0eZpYZpeeMkPrTFuYHw wkzmYMAFMBigaGHIToD8H1Mzq0zB/CkB/TVRC16pPdJv/mCV8h9Q5OlsfYWx5L71pKKL 4yBrFGesWjwRfQAOW6UCMTq29cHFFT1JMtw7s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701455490; x=1702060290; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=V5Q+AM+DhOXR89Ju18vzTGC3wrGXus7g2e66yEQ6u/o=; b=oe5k/BSSdfZSX46DuJY1PPQglscX9HdM4OA2fq6TiFJYGL1U5WiNO9I92nUXWtizEY yF8O2EXqFpeN88SD1xrhJsPe5vP9Vxa8Kw8OvXBHomDmbkGOsQaIMOxMcpNAVLOKmIg5 EU4OnqJxLGsemQnRtu74o/9kACGUl3mx8+qNkRyQ0V5kqQwY+c0A4iDwy5mOQyW4/LmI TxEeAqW0qCm2eTJnVu2EXuDnZksArD31JUi305Bcm0Z3v2lOu8jnvoddVxsSMDk2L97o YkgiB9owuwS/w/Xkp7AOwOV0Zo0Za3IBQ55vaDruBkF//vG4+601REEUDh+vknxKiX5v 9EeA== X-Gm-Message-State: AOJu0Yy0Tje+4+LtaiIOIcQ5KCv1ff/g6HJaAhgA1nT3UmbjnUpnaMca D3naoz1CEceuVa0c7blzpSSaYg== X-Received: by 2002:a05:6a00:23c4:b0:6cb:cd66:2102 with SMTP id g4-20020a056a0023c400b006cbcd662102mr35720154pfc.4.1701455490601; Fri, 01 Dec 2023 10:31:30 -0800 (PST) Received: from tictac2.mtv.corp.google.com ([2620:15c:9d:2:11eb:92ac:94e:c791]) by smtp.gmail.com with ESMTPSA id g11-20020a056a00078b00b006cdda10bdafsm3306926pfu.183.2023.12.01.10.31.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 10:31:30 -0800 (PST) From: Douglas Anderson <dianders@chromium.org> To: linux-usb@vger.kernel.org, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, "David S . Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com> Cc: Grant Grundler <grundler@chromium.org>, Hayes Wang <hayeswang@realtek.com>, Simon Horman <horms@kernel.org>, =?utf-8?q?Bj=C3=B8rn_Mork?= <bjorn@mork.no>, netdev@vger.kernel.org, Brian Geffon <bgeffon@google.com>, Alan Stern <stern@rowland.harvard.edu>, Douglas Anderson <dianders@chromium.org>, Hans de Goede <hdegoede@redhat.com>, Heikki Krogerus <heikki.krogerus@linux.intel.com>, "Rafael J. Wysocki" <rafael@kernel.org>, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/3] usb: core: Don't force USB generic_subclass drivers to define probe() Date: Fri, 1 Dec 2023 10:29:50 -0800 Message-ID: <20231201102946.v2.1.I7ea0dd55ee2acdb48b0e6d28c1a704ab2c29206f@changeid> X-Mailer: git-send-email 2.43.0.rc2.451.g8631bc7472-goog In-Reply-To: <20231201183113.343256-1-dianders@chromium.org> References: <20231201183113.343256-1-dianders@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 01 Dec 2023 10:31:49 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784105429736670288 X-GMAIL-MSGID: 1784105429736670288 |
Series |
net: usb: r8152: Fix lost config across deauthorize+authorize
|
|
Commit Message
Doug Anderson
Dec. 1, 2023, 6:29 p.m. UTC
There's no real reason that subclassed USB drivers _need_ to define
probe() since they might want to subclass for some other reason. Make
it optional to define probe() if we're a generic_subclass.
Signed-off-by: Douglas Anderson <dianders@chromium.org>
---
Changes in v2:
- ("Don't force USB generic_subclass drivers to define ...") new for v2.
drivers/usb/core/driver.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
Comments
On Fri, Dec 01, 2023 at 10:29:50AM -0800, Douglas Anderson wrote: > There's no real reason that subclassed USB drivers _need_ to define > probe() since they might want to subclass for some other reason. Make > it optional to define probe() if we're a generic_subclass. > > Signed-off-by: Douglas Anderson <dianders@chromium.org> > --- Reviewed-by: Alan Stern <stern@rowland.harvard.edu> > Changes in v2: > - ("Don't force USB generic_subclass drivers to define ...") new for v2. > > drivers/usb/core/driver.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c > index f58a0299fb3b..1dc0c0413043 100644 > --- a/drivers/usb/core/driver.c > +++ b/drivers/usb/core/driver.c > @@ -290,7 +290,10 @@ static int usb_probe_device(struct device *dev) > * specialised device drivers prior to setting the > * use_generic_driver bit. > */ > - error = udriver->probe(udev); > + if (udriver->probe) > + error = udriver->probe(udev); > + else if (!udriver->generic_subclass) > + error = -EINVAL; > if (error == -ENODEV && udriver != &usb_generic_driver && > (udriver->id_table || udriver->match)) { > udev->use_generic_driver = 1; > -- > 2.43.0.rc2.451.g8631bc7472-goog >
On Fri, Dec 1, 2023 at 10:31 AM Douglas Anderson <dianders@chromium.org> wrote: > > There's no real reason that subclassed USB drivers _need_ to define > probe() since they might want to subclass for some other reason. Make > it optional to define probe() if we're a generic_subclass. > > Signed-off-by: Douglas Anderson <dianders@chromium.org> Reviewed-by: Grant Grundler <grundler@chromium.org> Thanks for pursuing this Doug! cheers, grant > --- > > Changes in v2: > - ("Don't force USB generic_subclass drivers to define ...") new for v2. > > drivers/usb/core/driver.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c > index f58a0299fb3b..1dc0c0413043 100644 > --- a/drivers/usb/core/driver.c > +++ b/drivers/usb/core/driver.c > @@ -290,7 +290,10 @@ static int usb_probe_device(struct device *dev) > * specialised device drivers prior to setting the > * use_generic_driver bit. > */ > - error = udriver->probe(udev); > + if (udriver->probe) > + error = udriver->probe(udev); > + else if (!udriver->generic_subclass) > + error = -EINVAL; > if (error == -ENODEV && udriver != &usb_generic_driver && > (udriver->id_table || udriver->match)) { > udev->use_generic_driver = 1; > -- > 2.43.0.rc2.451.g8631bc7472-goog >
diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c index f58a0299fb3b..1dc0c0413043 100644 --- a/drivers/usb/core/driver.c +++ b/drivers/usb/core/driver.c @@ -290,7 +290,10 @@ static int usb_probe_device(struct device *dev) * specialised device drivers prior to setting the * use_generic_driver bit. */ - error = udriver->probe(udev); + if (udriver->probe) + error = udriver->probe(udev); + else if (!udriver->generic_subclass) + error = -EINVAL; if (error == -ENODEV && udriver != &usb_generic_driver && (udriver->id_table || udriver->match)) { udev->use_generic_driver = 1;