From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CBF89C001DB for ; Wed, 21 Jun 2023 13:29:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232597AbjFUN3f (ORCPT ); Wed, 21 Jun 2023 09:29:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232580AbjFUN3d (ORCPT ); Wed, 21 Jun 2023 09:29:33 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6DCC819BE for ; Wed, 21 Jun 2023 06:29:27 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id EA6C0614E4 for ; Wed, 21 Jun 2023 13:29:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EFFFCC433C8; Wed, 21 Jun 2023 13:29:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1687354166; bh=np9mHCRiqRRBNekCxcRUUEThiL9MG4PCDfK8Wp/e3zs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=2iAz1i5EPckAUneLsjcYlnTOdGKBOinobEOO+j2HRrr1srOxa1ZVLIVRO4eAeszk4 2QqdmNAsoDKVBBjYT8WdxGoMkXbvuJ1ZWtp71psHTMRq0o5qbmWlQDUHkwQxd2R4q0 99WgPZOSnpgWDWYDGOdLiIQ5GaoVhliiI8Y5Yzc4= Date: Wed, 21 Jun 2023 15:29:23 +0200 From: Greg Kroah-Hartman To: Ivan Orlov Cc: linux-usb@vger.kernel.org Subject: Re: [PATCH 6/6] USB: file.c: make usb class a static const structure Message-ID: <2023062110-portfolio-partner-d010@gregkh> References: <20230620094412.508580-7-gregkh@linuxfoundation.org> <20230620094412.508580-12-gregkh@linuxfoundation.org> <2023062000-consuming-crusher-8a92@gregkh> <33236558-8987-0b84-bef0-613fec01f965@gmail.com> <2023062111-uptown-unpack-0fb1@gregkh> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org On Wed, Jun 21, 2023 at 05:06:34PM +0400, Ivan Orlov wrote: > On 6/21/23 16:48, Greg Kroah-Hartman wrote: > > I think we should make it simpler, allocate the class when we start up, > > and free it when we shut down, which guarantees that all users of the > > class are removed at that time as this is part of the usb core code. > > > > No need to be fancy anymore with the dynamic creation/removal of the > > class, it's just not worth it :) > > > > thanks, > > > > greg k-h > > Alright, it sounds really reasonable, let's do it in this way :) > > I'll add init_usb_class call to the 'usb_init' function and the > corresponding releasing function call to the 'usb_exit' function in the > 'drivers/usb/core/usb.c' file. So we would register class at startup and > unregister it when shutting down. > Totally reasonable, thanks for doing this work. greg k-h