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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5B092C27C76 for ; Sat, 28 Jan 2023 13:29:26 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id AF4CF851; Sat, 28 Jan 2023 14:28:33 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz AF4CF851 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1674912563; bh=gbVb0kAg5hpJyj539xNOunFy+rh05joLI900TjEcRZU=; h=Date:From:To:Subject:References:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=OMCfmDfzQiHUA0zKJwy1UsGpXgL4WSoa5Sc9yxCvYJrf8jJ6llGV8tRd/B7RV6jb5 pqX+pmSu//7itAwtaOMdtuwLRye1+nqETaZJ9QVbqaVNV4s08TeEy6sKiLjPURKpRN ajqC8hyS0MSAiFaNisClxh2cmlKTob/Uukphccoc= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 65A82F8025D; Sat, 28 Jan 2023 14:28:33 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id F0C7FF8027D; Sat, 28 Jan 2023 14:28:29 +0100 (CET) Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 2518EF8007C for ; Sat, 28 Jan 2023 14:28:25 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 2518EF8007C Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=fSLeRYss Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D6D7360BE9; Sat, 28 Jan 2023 13:28:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B38D9C433EF; Sat, 28 Jan 2023 13:28:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1674912502; bh=gbVb0kAg5hpJyj539xNOunFy+rh05joLI900TjEcRZU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=fSLeRYssvJmeBHQiGEXXJSK1YvT9JuojmLmMCIAGjbqnWXt62447VxdkmVtMrlbyC pln3GTfSA4rybbKVaD1iFxIH7MJP6AWuCG0EfX13nCvZKlaTOWGY1d/ozFi510duVK jHzl1CQzPu1lQxZgElaWHbIaNlpXQoXf9JcOnmFY= Date: Sat, 28 Jan 2023 14:28:19 +0100 From: Greg KH To: Wesley Cheng Subject: Re: [RFC PATCH v2 12/22] sound: usb: card: Introduce USB SND platform op callbacks Message-ID: References: <20230126031424.14582-1-quic_wcheng@quicinc.com> <20230126031424.14582-13-quic_wcheng@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230126031424.14582-13-quic_wcheng@quicinc.com> X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, linux-usb@vger.kernel.org, bgoswami@quicinc.com, mathias.nyman@intel.com, Thinh.Nguyen@synopsys.com, andersson@kernel.org, tiwai@suse.com, lgirdwood@gmail.com, robh+dt@kernel.org, broonie@kernel.org, srinivas.kandagatla@linaro.org, agross@kernel.org, krzysztof.kozlowski+dt@linaro.org, linux-arm-msm@vger.kernel.org, quic_plai@quicinc.com, linux-kernel@vger.kernel.org, quic_jackp@quicinc.com Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On Wed, Jan 25, 2023 at 07:14:14PM -0800, Wesley Cheng wrote: > Allow for different platforms to be notified on USB SND connect/disconnect > seqeunces. This allows for platform USB SND modules to properly initialize > and populate internal structures with references to the USB SND chip > device. > > Signed-off-by: Wesley Cheng > --- > sound/usb/card.c | 28 ++++++++++++++++++++++++++++ > sound/usb/card.h | 20 ++++++++++++++++++++ > 2 files changed, 48 insertions(+) > > diff --git a/sound/usb/card.c b/sound/usb/card.c > index 26268ffb8274..803230343c16 100644 > --- a/sound/usb/card.c > +++ b/sound/usb/card.c > @@ -117,6 +117,24 @@ MODULE_PARM_DESC(skip_validation, "Skip unit descriptor validation (default: no) > static DEFINE_MUTEX(register_mutex); > static struct snd_usb_audio *usb_chip[SNDRV_CARDS]; > static struct usb_driver usb_audio_driver; > +static struct snd_usb_platform_ops *platform_ops; You can not have a single "platform_ops" pointer, this HAS to be per-bus. And what is a "platform operations" anyway? Shouldn't this be a driver type or something like that? "offload_operations"? > + > +int snd_usb_register_platform_ops(struct snd_usb_platform_ops *ops) > +{ > + if (platform_ops) > + return -EEXIST; > + > + platform_ops = ops; > + return 0; No locking? not good. But again, this has to be per-USB-bus, it can NOT be system wide for obvious reasons. thanks, greg k-h