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 44D24C3DA49 for ; Fri, 26 Jul 2024 08:32:08 +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 B4C6CB76; Fri, 26 Jul 2024 10:31:56 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz B4C6CB76 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1721982726; bh=SaWF+4KJQU0XUGHZ2RnknEncK0bztWKxjR5PTu+Y7hE=; h=Date:From:To:CC:Subject:References:In-Reply-To:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=hhDGLzVWvFUaVUld5ebPGdB3TBo5SS46I+ySe2iVxa0PZ5VO/CmLg8yV0muhb5P8V HfvvsrYxhRbz23KibvcQMH3ma7LNZDPO/5uBDl/jWfhnq4wl6G6FBuj+5uMWdaxGIs WC1nC6MuJm2UjXwmFberk2e6PUjE17bmYmT3m6Dk= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 7B8F2F8013D; Fri, 26 Jul 2024 10:31:54 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 6E424F805B5; Fri, 26 Jul 2024 10:31:53 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id F2291F801F5; Fri, 26 Jul 2024 10:19:29 +0200 (CEST) Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 848D4F801F5 for ; Fri, 26 Jul 2024 10:13:57 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 848D4F801F5 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=cirrus.com header.i=@cirrus.com header.a=rsa-sha256 header.s=PODMain02222019 header.b=o9qLQSb/ Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 46Q6nlm2014217; Fri, 26 Jul 2024 03:13:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=cc :content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to; s=PODMain02222019; bh=Fsrg6RkL3ljELUDbdF raOMnuDGBzLzBG9berJqeS99w=; b=o9qLQSb/6FYQi/W15D8/Q6B22hsutkg88J mNvNh/AZ9dtqrOtTI2R79TLXpy8lg1lRKFhIl6wq6uiLWlhJxh1WDOawKX7VlaCO eU4rIuRfd03jDKIDXA77BqwjD/sjpjlrViwwSQ4PT0Lh9y7BbLCx3sB5ScZRuZYJ vNZcORfK21t/q+SSA5prVTMc95eHtVjvLmZqXGyBKNQbnzb9vRk/fzqO4TR9DyPL kzPctMSGrBR/TxYyv0GJbep/oRCXMW0g49lRFREAm4X4hdll9PMJyP+uXK1OcV7U L5pHZHo0u48Al18wep6LoWHV38jlkQySIDlmkNZa06BVjUwfSSdg== Received: from ediex01.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 40m1mdr9bp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 26 Jul 2024 03:13:56 -0500 (CDT) Received: from ediex02.ad.cirrus.com (198.61.84.81) by ediex01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Fri, 26 Jul 2024 09:13:54 +0100 Received: from ediswmail9.ad.cirrus.com (198.61.86.93) by anon-ediex02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server id 15.2.1544.9 via Frontend Transport; Fri, 26 Jul 2024 09:13:54 +0100 Received: from opensource.cirrus.com (ediswmail9.ad.cirrus.com [198.61.86.93]) by ediswmail9.ad.cirrus.com (Postfix) with ESMTPS id 8AA4D820244; Fri, 26 Jul 2024 08:13:54 +0000 (UTC) Date: Fri, 26 Jul 2024 09:13:53 +0100 From: Charles Keepax To: Javier Carrasco CC: Tim Harvey , Mauro Carvalho Chehab , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Ray Jui , Scott Branden , Broadcom internal kernel review list , David Rhodes , Richard Fitzgerald , Shenghao Ding , Kevin Lu , Baojun Xu , Olivier Moysan , "Arnaud Pouliquen" , Maxime Coquelin , Alexandre Torgue , Kunihiko Hayashi , Masami Hiramatsu , , , , , , , Subject: Re: [PATCH 2/2] ASoC: constify snd_soc_component_driver struct Message-ID: References: <20240725-const_snd_soc_component_driver-v1-0-3d7ee08e129b@gmail.com> <20240725-const_snd_soc_component_driver-v1-2-3d7ee08e129b@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20240725-const_snd_soc_component_driver-v1-2-3d7ee08e129b@gmail.com> X-Proofpoint-GUID: 5Vy4Ky4wKTO8OiKMKMdLcpITcmsfQPPw X-Proofpoint-ORIG-GUID: 5Vy4Ky4wKTO8OiKMKMdLcpITcmsfQPPw X-Proofpoint-Spam-Reason: safe Message-ID-Hash: M32PWDQE5XBRAKTLRI6JK4EQ43EVARPE X-Message-ID-Hash: M32PWDQE5XBRAKTLRI6JK4EQ43EVARPE X-MailFrom: prvs=49370cd301=ckeepax@opensource.cirrus.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Thu, Jul 25, 2024 at 12:31:40PM +0200, Javier Carrasco wrote: > The instances of the `snd_soc_component_driver` struct are not modified > after their declaration, and they are only passed to > `devm_snd_soc_register_component()`, which expects a constant > `snd_soc_component_driver`. > > Move all instances of `snd_soc_component_driver` to read-only sections > by declaring them const. > > Signed-off-by: Javier Carrasco > --- > sound/soc/codecs/cs43130.c | 2 +- > -static struct snd_soc_component_driver soc_component_dev_cs43130 = { > +static const struct snd_soc_component_driver soc_component_dev_cs43130 = { > .probe = cs43130_probe, > .controls = cs43130_snd_controls, > .num_controls = ARRAY_SIZE(cs43130_snd_controls), This won't work for cs43130, whilst what the driver does is clearly slightly sketch it directly modifies this struct before registering it with ASoC. That would need fixed first before this change can be made. Thanks, Charles