Message ID | 20230517111416.424420-1-krzysztof.kozlowski@linaro.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1050394vqo; Wed, 17 May 2023 04:15:43 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ57E4Ys69XABEP9oDRmNbzC5w2UFx07SV464fjFF8cq13utfRCviH19gHpPZP1lfRc0iCi3 X-Received: by 2002:a17:902:e888:b0:1ad:d500:19d3 with SMTP id w8-20020a170902e88800b001add50019d3mr25366916plg.23.1684322143007; Wed, 17 May 2023 04:15:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684322142; cv=none; d=google.com; s=arc-20160816; b=xQQEqtOp+AZ5J7hGP/CXou7uAcRuhHG8MiG8BRsrDWUBAnS+xHZE/mXF5TCmQ56qF5 Mm45sqlR9EDb0BHIUG+UJHnKUWiTjaHKx4sbSrH2l7Ydnm6/6v9G2VT1X7vNWMCs//dT XQ7JLcFoURtK6z3zDw9OqkFwl+4795RwC0XpvnRin2tY0flhdmqvTvPJvOuNo4H2hjce alDDqJKhP1QklqDM8EgG8dO7X4mS0rwAArIse8QcNzKY7mO+nCDEd8kZgRbIuyjjWAjq a5/Yyu9wY3elRxPTUfu4L2P28+rzTPORLHFq91pDjnZtyQAD1ETYf4kkqEq5D0DIfEXT 09dA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=8f/Ov+L9lgAMMtQvsESvWR48vQlBSC6eGHRApShSvK4=; b=IlsQ1sHZbLBhGmIN8EevayA/PwSvYmtPOHmSfa2OVLTKctRMgSZ9tvBm0K/b0hD4pD eRu03ljF4XXz0G8Qflflz/RaU5msp5IkxcnMMFsKVkwIKrL7TpWs6IrBYqcBab77cLiM jKb0zIBv/5pyMQgq+ESjrqR7Szz4iBspkZLgTTBMU5HaOdp8+ngeL9hBz9MXPH49bIjP ZwmgjbU+zSMQ5lq7hQYX8PziVQNTwKpn4ROsFlkfrgael2SzHA2Xnd5d7/UCFXP93EWF fyiz9JXiGDEvZMh7PyC9vIDLvN9F1GMvtaPG/dJUOV1dyHz45jwHcaTjtv4ZnC9X2akx 0z5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sIfEiJbF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b17-20020a170902ed1100b001ab18eb1764si8637671pld.131.2023.05.17.04.15.27; Wed, 17 May 2023 04:15:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sIfEiJbF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230389AbjEQLO5 (ORCPT <rfc822;pacteraone@gmail.com> + 99 others); Wed, 17 May 2023 07:14:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230125AbjEQLOm (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 17 May 2023 07:14:42 -0400 Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [IPv6:2a00:1450:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8434626AA for <linux-kernel@vger.kernel.org>; Wed, 17 May 2023 04:14:40 -0700 (PDT) Received: by mail-ej1-x634.google.com with SMTP id a640c23a62f3a-965f7bdab6bso111872466b.3 for <linux-kernel@vger.kernel.org>; Wed, 17 May 2023 04:14:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684322079; x=1686914079; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=8f/Ov+L9lgAMMtQvsESvWR48vQlBSC6eGHRApShSvK4=; b=sIfEiJbFesnboqrvDwg/JbxitCUki5aOESmQeTg6BQTaFmpQel55ARJNOzBd8Mm4FZ fL+tqM9jp+I4U1fmvk7eAQehUtyk/TO+AAf9RFsKbKkkeNL6LvaF4LYZf9tyVKUlhdHG i/DH2lMxWzJ7WPE4l4CfVfUWeP2GrHWEytoP6jrQX7Zkda97O0tWivR4CwTB9QHVEG1K rBrCq0Y2omMSb5Z4kuCIJMQcJtoef5ryB9wcSy0/JXqX6taG1+ccb7qg58us2ne/Zb0p 7V10XrAmSJFkQZ4ZLTGvktUpzOfMUh1Q3cz8HYSdwZJS0JiMw8iiZs2Yq8MuIiFD1/N1 tN3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684322079; x=1686914079; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=8f/Ov+L9lgAMMtQvsESvWR48vQlBSC6eGHRApShSvK4=; b=USG+B8m8dFBtOuwW1VlAu7vVzzRGDDTWrpReOjqyg5GXQ2w/pbZyOb9txGN4elu/nJ 6yLxBu0n1qtPjNZnpQFxUQebk033Oaaudk2FvpsVFUtpneyYgbv5a0ra2KAr7UniQPJ2 GjhxuBkTe8NyHRsSke2yW8HoNTb24FX/IUCtZFRtDLAKYeqbeAGoFeq2CJjSaFNgpEzZ MaJpdNwFZ3z4ZqrPAZEeC3Ph/GeLgfFvdT/jHo8LQFZYTb+4Yx7dXI5kEVUaVwTtfZ+s RZzMAgDWY+Q0MaWqe8EReVBvRNO8nTms7PaJRoJ5ra7Co4/XBilu55i7Eokl7cYi3gKy /4qg== X-Gm-Message-State: AC+VfDwhgfWiF3m4OwbuJLe+chvfdaIKtu5Kr1TS7umhTidl/9s4JfoL YsKlchlb2P/Wm0jNwNKdOx6Db52ndYFZmVFhe4s= X-Received: by 2002:a17:906:9c83:b0:95f:4889:412a with SMTP id fj3-20020a1709069c8300b0095f4889412amr39964429ejc.33.1684322078958; Wed, 17 May 2023 04:14:38 -0700 (PDT) Received: from krzk-bin.. ([2a02:810d:15c0:828:c9ff:4c84:dd21:568d]) by smtp.gmail.com with ESMTPSA id ml18-20020a170906cc1200b0094f124a37c4sm12326880ejb.18.2023.05.17.04.14.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 May 2023 04:14:38 -0700 (PDT) From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> To: Oder Chiou <oder_chiou@realtek.com>, Liam Girdwood <lgirdwood@gmail.com>, Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Subject: [PATCH 01/12] ASoC: codecs: rt1308: do not store status in state container Date: Wed, 17 May 2023 13:14:05 +0200 Message-Id: <20230517111416.424420-1-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766139775392597793?= X-GMAIL-MSGID: =?utf-8?q?1766139775392597793?= |
Series |
[01/12] ASoC: codecs: rt1308: do not store status in state container
|
|
Commit Message
Krzysztof Kozlowski
May 17, 2023, 11:14 a.m. UTC
Driver in its update status callback stores Soundwire device status in
state container but it never uses it later. Simplify the code a bit.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
sound/soc/codecs/rt1308-sdw.c | 5 +----
sound/soc/codecs/rt1308-sdw.h | 1 -
2 files changed, 1 insertion(+), 5 deletions(-)
Comments
On 5/17/23 06:14, Krzysztof Kozlowski wrote: > Driver in its update status callback stores Soundwire device status in > state container but it never uses it later. Simplify the code a bit. > > Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Good cleanup, not sure why we added this internal status many moons ago. There's already a slave->status that's updated in drivers/soundwire/bus.c, fewer state variables are better and in this case there's no reason to keep a value that could be stale. For the series Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> > --- > sound/soc/codecs/rt1308-sdw.c | 5 +---- > sound/soc/codecs/rt1308-sdw.h | 1 - > 2 files changed, 1 insertion(+), 5 deletions(-) > > diff --git a/sound/soc/codecs/rt1308-sdw.c b/sound/soc/codecs/rt1308-sdw.c > index 1797af824f60..313e97c94532 100644 > --- a/sound/soc/codecs/rt1308-sdw.c > +++ b/sound/soc/codecs/rt1308-sdw.c > @@ -304,9 +304,6 @@ static int rt1308_update_status(struct sdw_slave *slave, > { > struct rt1308_sdw_priv *rt1308 = dev_get_drvdata(&slave->dev); > > - /* Update the status */ > - rt1308->status = status; > - > if (status == SDW_SLAVE_UNATTACHED) > rt1308->hw_init = false; > > @@ -314,7 +311,7 @@ static int rt1308_update_status(struct sdw_slave *slave, > * Perform initialization only if slave status is present and > * hw_init flag is false > */ > - if (rt1308->hw_init || rt1308->status != SDW_SLAVE_ATTACHED) > + if (rt1308->hw_init || status != SDW_SLAVE_ATTACHED) > return 0; > > /* perform I/O transfers required for Slave initialization */ > diff --git a/sound/soc/codecs/rt1308-sdw.h b/sound/soc/codecs/rt1308-sdw.h > index 04ff18fa18e2..f816c73e247e 100644 > --- a/sound/soc/codecs/rt1308-sdw.h > +++ b/sound/soc/codecs/rt1308-sdw.h > @@ -159,7 +159,6 @@ struct rt1308_sdw_priv { > struct snd_soc_component *component; > struct regmap *regmap; > struct sdw_slave *sdw_slave; > - enum sdw_slave_status status; > struct sdw_bus_params params; > bool hw_init; > bool first_hw_init;
On Wed, 17 May 2023 13:14:05 +0200, Krzysztof Kozlowski wrote: > Driver in its update status callback stores Soundwire device status in > state container but it never uses it later. Simplify the code a bit. > > Applied to https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next Thanks! [01/12] ASoC: codecs: rt1308: do not store status in state container commit: cc3ff544a296b5b4bb021f4dc415b53a6955b980 [02/12] ASoC: codecs: rt1316: do not store status in state container commit: 70207b95b2245502496443475c9fc4eb72ba3b66 [03/12] ASoC: codecs: rt1318: do not store status in state container commit: 28eb1e4224c3b3ff29fe4c29bcdc011d3a0ffd07 [04/12] ASoC: codecs: rt5682: do not store status in state container commit: 758665b15acc1adb21a833c6456746ffbce07ed7 [05/12] ASoC: codecs: rt700: do not store status in state container commit: 9564c9f691128bc2dc69de02f7eed205d9b2513f [06/12] ASoC: codecs: rt711-sdca: do not store status in state container commit: 8322947e9228ef7f8c3dd13822d32c491f9488e7 [07/12] ASoC: codecs: rt711: do not store status in state container commit: 22e15c18b4a91c71bf66de06187b8a3199bb8cad [08/12] ASoC: codecs: rt712-sdca-dmic: do not store status in state container commit: d7a79616fc723305094fd7391085428b7a893636 [09/12] ASoC: codecs: rt712-sdca: do not store status in state container commit: 5cd02f96f49a7e6d2f8b96ddc42092776b554873 [10/12] ASoC: codecs: rt715-sdca: do not store status in state container commit: cda72c89d082f5953fab9948fc1212ca0df11d96 [11/12] ASoC: codecs: rt715: do not store status in state container commit: 0315dac5406c9c0b8e334195aa01c4ec155adf47 [12/12] ASoC: codecs: rt722-sdca: do not store status in state container commit: b932f21f6678659bd434c0d47e3bebc94bae0a51 All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark
diff --git a/sound/soc/codecs/rt1308-sdw.c b/sound/soc/codecs/rt1308-sdw.c index 1797af824f60..313e97c94532 100644 --- a/sound/soc/codecs/rt1308-sdw.c +++ b/sound/soc/codecs/rt1308-sdw.c @@ -304,9 +304,6 @@ static int rt1308_update_status(struct sdw_slave *slave, { struct rt1308_sdw_priv *rt1308 = dev_get_drvdata(&slave->dev); - /* Update the status */ - rt1308->status = status; - if (status == SDW_SLAVE_UNATTACHED) rt1308->hw_init = false; @@ -314,7 +311,7 @@ static int rt1308_update_status(struct sdw_slave *slave, * Perform initialization only if slave status is present and * hw_init flag is false */ - if (rt1308->hw_init || rt1308->status != SDW_SLAVE_ATTACHED) + if (rt1308->hw_init || status != SDW_SLAVE_ATTACHED) return 0; /* perform I/O transfers required for Slave initialization */ diff --git a/sound/soc/codecs/rt1308-sdw.h b/sound/soc/codecs/rt1308-sdw.h index 04ff18fa18e2..f816c73e247e 100644 --- a/sound/soc/codecs/rt1308-sdw.h +++ b/sound/soc/codecs/rt1308-sdw.h @@ -159,7 +159,6 @@ struct rt1308_sdw_priv { struct snd_soc_component *component; struct regmap *regmap; struct sdw_slave *sdw_slave; - enum sdw_slave_status status; struct sdw_bus_params params; bool hw_init; bool first_hw_init;