From patchwork Tue Sep 12 04:51:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu X-Patchwork-Id: 13380664 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 83B50CA0EC3 for ; Tue, 12 Sep 2023 04:53:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ZOWXo/QpHwFrTcrRnZAWjPgLP4aQIilCZUTBs9vwvuc=; b=usCSPVRHHa9i4Z vtQl0jK5YTqHbvjymKiFxzz/ZlJ9ifR4T9XJHBpNKmL6ANfT7l8XOrFRXleuYs1SwCahqCkYjOf40 EHJ9RuxDuL0OOf4Vv4t5uicN+lP1zJuzP70vR1Jd9NXep5Zr024P6NpivC3hfcYXNKb2h1bmRlwrn zUREUJv+sIVm5LT2RQ7lfqIXVjRJNn0N0oOmhKD04KvPjQp0AqInu9b6ltFNFQ++zJbTWtlCqNA5r GQWxbES12fpT55V2yhYpO3fDo8yHGdLI7Nn6EuEGDeirGUfLd9nCz0OaLyTVkYJlUUIyRsXBdsZ5f wJHHUeRA3GnX+7Q8bn+A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qfvOI-0027Vz-0J; Tue, 12 Sep 2023 04:52:46 +0000 Received: from mail-ed1-x52a.google.com ([2a00:1450:4864:20::52a]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qfvOC-0027RW-26 for linux-arm-kernel@lists.infradead.org; Tue, 12 Sep 2023 04:52:41 +0000 Received: by mail-ed1-x52a.google.com with SMTP id 4fb4d7f45d1cf-51e28cac164so13436477a12.1 for ; Mon, 11 Sep 2023 21:52:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1694494359; x=1695099159; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=c/QQ+pzGaKCLEtkSfzXPg0nfGWLMjKop4b6FhGuhCMU=; b=XBSZw4zgGnYRkG2hlhWB8rCmYVDHSnZYez0OXtXhTqFs84i49/6VuPr6l7k4yEBe5W FhHbsPUdMG7obsyV1kJM07pDs/AEbzD2lmTYZyBogN5t4nHv6VzGA1Y4V8UoeyzZgHm5 JZJxIrCSyCzeOzmZVegoRN8IaniyjKqp3vpokyiShTPwBsP58zUH6pOnuzSR0biKPE/e EAV+IIJXCfFOmL3ooI5velJbpN2hb/0qMSI3vt97GLsim/2fWdaV0wk1KtnxNhHHw6Lo Hb0wG7I+DSseaVut0GUKY2Ugjrd0VTmUVsNVDqp+iQh+EpOzvPm3qqJUvi7HXUq22FTa HeYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694494359; x=1695099159; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=c/QQ+pzGaKCLEtkSfzXPg0nfGWLMjKop4b6FhGuhCMU=; b=Aa+/KdR71RsHHsC169L5Eq6HJs1scmmLqXWP2BZdKcXWpbP29P9rjSLKkrpDwUkvSX /4Wox7fB7M53x42BnnHZO4FV5a6clAa0HHyFNKB2cGgOx7Xy/0hgXVsyea5LzACOuJeD abfW3XVZPv70aTNZ3oFR5PQjOIJGAi8DUMaLwA8/RJuYIjqwsiWbWhntxXoCSLiJydAg hv78aGQizuynrd6ElZfcJzS/tzXjdx2Xmu21n6wnbifUNXD5BWKk9zyXS3tNLIopMzGz jVa44QlctLYPTwBevHOVLMXsLHK8mhLCNz6Ckjj1Zq2NwpFSZqkFn4KMX6zVoRMkHiLh 3JqA== X-Gm-Message-State: AOJu0YxKgL/x8rfZ9UCqpfOEl2TWRN93GhNWgzCHyjDT9X/siuCiy63h hMVWrfLHbPbtQXn6Rpg62wOUig== X-Google-Smtp-Source: AGHT+IHOeFoaBGmGEVaMe9QVI6eGxLkERWdiTBlKcpER9LrrvOlg5Al5pU8Bs+zay+AHLcLZg1/wlQ== X-Received: by 2002:a17:906:7311:b0:9aa:1dc9:1474 with SMTP id di17-20020a170906731100b009aa1dc91474mr2204329ejc.33.1694494359466; Mon, 11 Sep 2023 21:52:39 -0700 (PDT) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.145]) by smtp.gmail.com with ESMTPSA id f21-20020a05640214d500b0051e22660835sm5422415edx.46.2023.09.11.21.52.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Sep 2023 21:52:39 -0700 (PDT) From: Claudiu X-Google-Original-From: Claudiu To: geert+renesas@glider.be, mturquette@baylibre.com, sboyd@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, ulf.hansson@linaro.org, linus.walleij@linaro.org, gregkh@linuxfoundation.org, jirislaby@kernel.org, magnus.damm@gmail.com, catalin.marinas@arm.com, will@kernel.org, prabhakar.mahadev-lad.rj@bp.renesas.com, biju.das.jz@bp.renesas.com, quic_bjorande@quicinc.com, arnd@arndb.de, konrad.dybcio@linaro.org, neil.armstrong@linaro.org, nfraprado@collabora.com, rafal@milecki.pl, wsa+renesas@sang-engineering.com Cc: linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, linux-gpio@vger.kernel.org, linux-serial@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Claudiu Beznea Subject: [PATCH 11/37] clk: renesas: rzg2l: simplify a bit the logic in rzg2l_mod_clock_endisable() Date: Tue, 12 Sep 2023 07:51:31 +0300 Message-Id: <20230912045157.177966-12-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230912045157.177966-1-claudiu.beznea.uj@bp.renesas.com> References: <20230912045157.177966-1-claudiu.beznea.uj@bp.renesas.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230911_215240_686835_06F89863 X-CRM114-Status: GOOD ( 11.76 ) 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 From: Claudiu Beznea The bitmask << 16 is anyway set on both branches of if thus move it before the if and set the lower bits of registers only in case clock is enabled. Signed-off-by: Claudiu Beznea Reviewed-by: Geert Uytterhoeven --- drivers/clk/renesas/rzg2l-cpg.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/clk/renesas/rzg2l-cpg.c b/drivers/clk/renesas/rzg2l-cpg.c index 44226682db2c..6c289223a4e2 100644 --- a/drivers/clk/renesas/rzg2l-cpg.c +++ b/drivers/clk/renesas/rzg2l-cpg.c @@ -914,10 +914,9 @@ static int rzg2l_mod_clock_endisable(struct clk_hw *hw, bool enable) enable ? "ON" : "OFF"); spin_lock_irqsave(&priv->rmw_lock, flags); + value = bitmask << 16; if (enable) - value = (bitmask << 16) | bitmask; - else - value = bitmask << 16; + value |= bitmask; writel(value, priv->base + CLK_ON_R(reg)); spin_unlock_irqrestore(&priv->rmw_lock, flags);