Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp6642091rdb; Fri, 15 Dec 2023 04:41:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IFFEnV4sIBdHF8yAVK4dbHzxCrKwzue/34kP1VTt6/8HSVnRF/qzlVzukerScZrExqKe45T X-Received: by 2002:a05:6a00:10d1:b0:6ce:48e7:e668 with SMTP id d17-20020a056a0010d100b006ce48e7e668mr7946219pfu.26.1702644105894; Fri, 15 Dec 2023 04:41:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702644105; cv=none; d=google.com; s=arc-20160816; b=FDXqlTkAHb6aPGGyUOPXxTwL+P+OvirfhXW1IcGbBNmz8WtMfCIbT4xX28rikaatdB jPH64Vfp9xA7/vMzwzJonBI4p0AxXGdT8h4vmA/MljkvoZMP2SYFv2JeF//qwb1gkIyT WHN879TOtGoWRzu0nlfa1NMwQQNC1rLf9HbBpWlo5sAvRSXscI5yOwZaALbCHtc43Fep DEbt0BDhFORcCZkZQVLQMKzVhfpS4/OubGRMgfu3V1zhoG+4V1n5olZy75RdxagDstnM wK3IWmzPdZ+R3ZtA/LhdKkJIfOeul3gKX+11klsy0KwqPNHCB27mK615neSH0MXFNrVw 95OA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=wbIHiRqvW6oXqopGOBZ0pFrQKjWLXUam+KoHPU3k/pg=; fh=7ItgJbgZwvecrcoeWadzFWjHwQIXYWOLU+iGPv1nNik=; b=YcGZCJU/cMYWE0LEj4/adRFT0RraEtHuZ4P5bSfWL49JmUVY7VuAmUyTutwBJEjGyr /9pv/ynLOYxlTt11ttF5oKHcbabt9bz9vw3o9pcudxaicwxtpWK1LGuxBB+p4SPUc53T fLngMztO/wBVITu5hEpEdjyJ0DrvL0QIfDKa+BLmCUf0np9uS2mrq5OB4r7QZkKR2iYD zN1KuPID/8hcelO8ceIKNR4M87a/+VXbRsnBY5WKNUOairn59ytg/5JD4yZes36OMAkO YwN+Yrxaq2fJOm6ysFSEB+J2i1p7ETxdnDjT6nPy2O9IVifsdMbZxWxkVBc0SECa0fGx 4BuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=oift66yL; spf=pass (google.com: domain of linux-kernel+bounces-939-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-939-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id a15-20020a056a000c8f00b006cbd28f1f43si13374568pfv.47.2023.12.15.04.41.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 04:41:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-939-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=oift66yL; spf=pass (google.com: domain of linux-kernel+bounces-939-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-939-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 0CBC9B21A64 for ; Fri, 15 Dec 2023 12:41:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1C7F22D616; Fri, 15 Dec 2023 12:41:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="oift66yL" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4D6972DB6F; Fri, 15 Dec 2023 12:41:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5D637C433C8; Fri, 15 Dec 2023 12:40:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1702644059; bh=H5vSnFV7lt8AZLObSg4tyj2EUOKsSjouP970nDGMkbc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=oift66yLi2kgVZWCqJIbdxJ0IPCj2z4/h1jbGxhZvbg3m0tubNvAzKCk1TAXx9DHc SKPqGJ9me6ZoomoBysmKoAnH9VTDvV4GDdSNe6n2ckm0MttGaXYyJdwHOLJcZTO5Vk crQdlzR5nGV+QVw7S5Zrb3YacGANSRFm5pf6o8Zo= Date: Fri, 15 Dec 2023 13:40:57 +0100 From: Greg KH To: Yajun Deng Cc: marcel@holtmann.org, johan.hedberg@gmail.com, luiz.dentz@gmail.com, wg@grandegger.com, mkl@pengutronix.de, aspriel@gmail.com, franky.lin@broadcom.com, hante.meuleman@broadcom.com, kvalo@kernel.org, briannorris@chromium.org, mka@chromium.org, johan@kernel.org, oneukum@suse.com, stern@rowland.harvard.edu, valentina.manea.m@gmail.com, shuah@kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] USB: core: Use device_driver directly in struct usb_driver and usb_device_driver Message-ID: <2023121505-dexterity-rectal-8898@gregkh> References: <20231215063101.792991-1-yajun.deng@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231215063101.792991-1-yajun.deng@linux.dev> On Fri, Dec 15, 2023 at 02:31:01PM +0800, Yajun Deng wrote: > There is usbdrv_wrap in struct usb_driver and usb_device_driver, > it contains device_driver and for_devices. for_devices is used to > distinguish between device drivers and interface drivers. Yes. > We can compare that if 'drv->probe' is equal to usb_probe_device instead > of using for_devices in is_usb_device_driver(). Why? > Remove struct usbdrv_wrap, use device_driver directly in struct usb_driver > and usb_device_driver. This makes the code more concise. Really? What does this help out with? Are there future changes that require this? I'm all for cleanups, but I don't see what this helps with. Also, you have a coding style issue in this patch, which means I couldn't take it anyway: > +extern int usb_probe_device(struct device *dev); We don't do that in .c files :( thanks, greg k-h