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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 E0C21C3DA49 for ; Fri, 26 Jul 2024 08:14:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:CC:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Fsrg6RkL3ljELUDbdFraOMnuDGBzLzBG9berJqeS99w=; b=Us4X0qZbpPs2uAI0ohOQDV7PRF R5a2T1OKIgO8lUAzmiDeXdV/x765nWnikT9m/ocNgeytPJlrW7FkDZuPVx1p9igHsye6mPQ/+kG2g zim5rOgCbOpwedQd7mnOULpdxPEODTfpPOHP1aaG8MSXTHVeeVLOc4TzDodA9l3d68OXBvoWVcBqa 0DF4GPbCc3Kz9hUJRvc78XLwAwIcaPUqfAx+TEGShc/34o5zMkxxeboRpEgSuruMIzP/wODZCOFft mS9+R0zL0kbzZh8Bep0CijkRs66RR1vSUv+7ODrqa/kvgXUCjtCTiKiM7IMW7yoeEpInm2re726NR ssgFVe8Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sXG65-00000003I7p-2I6p; Fri, 26 Jul 2024 08:14:41 +0000 Received: from mx0b-001ae601.pphosted.com ([67.231.152.168]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sXG5g-00000003I5D-0U4C for linux-arm-kernel@lists.infradead.org; Fri, 26 Jul 2024 08:14:18 +0000 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240726_011416_492609_5B423D41 X-CRM114-Status: GOOD ( 15.14 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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