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 phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 683AFC433EF for ; Sun, 24 Apr 2022 08:22:54 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C577C83E57; Sun, 24 Apr 2022 10:22:26 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=lexina.in Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=lexina.in header.i=@lexina.in header.b="QfnvLTo4"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id AB16183DFE; Sun, 24 Apr 2022 10:22:17 +0200 (CEST) Received: from mx.msync.work (mx.msync.work [185.250.0.168]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 3E4F883E3B for ; Sun, 24 Apr 2022 10:22:10 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=lexina.in Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=adeep@lexina.in Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 5D66E52F2A; Sun, 24 Apr 2022 08:22:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lexina.in; s=dkim; t=1650788529; h=from:subject:date:message-id:to:mime-version: content-transfer-encoding:in-reply-to:references; bh=hCyvAledVEA5jmOB5QU6iGsaTZiPZy2ZrPaf1mSVERE=; b=QfnvLTo4z2fzn/WVa1FlRc+k1PUi52ryBiLDFyhSPD3mal30re1sKUAQsf7L/ZRIZ/fhMg 3ziR7/CtOeqmcyTBHbVjD2GmxQHg94FsfZzfy9OEBo8M3Abnk22CfQ1iq+O0F/PjOwKk7u /GKaXsRCeMKUH05A1tmfWJdMqvsoFqSrjELZgGUwHvyx4B0WPykoOmpX7Dh6K61ZZf2SBj XRySziF/X9eLQkgyt0LTjoFVfkNL/c8DjrZC7qG2QDBu2bAV2KDiJW0bdpvrYR1Qps6fC4 41tYYv/zwTv1yAVcdemz3mAFuSZcN3qDmUDi3fZOB9hG8OgB45CHR6V2HXURWw== From: Vyacheslav Bocharov To: Neil Armstrong , Lukasz Majewski , Sean Anderson , u-boot@lists.denx.de, u-boot-amlogic@groups.io Subject: [PATCH v3 3/6] clk: meson: update driver for g12a-ao clocks Date: Sun, 24 Apr 2022 11:21:56 +0300 Message-Id: <20220424082159.757622-4-adeep@lexina.in> In-Reply-To: <20220424082159.757622-1-adeep@lexina.in> References: <20220424082159.757622-1-adeep@lexina.in> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Last-TLS-Session-Version: TLSv1.3 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean Update g12a-ao clk driver: - move clk->id check to .request function - remove unnecessary check (gate->reg == 0) Signed-off-by: Vyacheslav Bocharov --- drivers/clk/meson/g12a-ao.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/clk/meson/g12a-ao.c b/drivers/clk/meson/g12a-ao.c index 17b11eb52a..1a855a6896 100644 --- a/drivers/clk/meson/g12a-ao.c +++ b/drivers/clk/meson/g12a-ao.c @@ -28,14 +28,8 @@ static int meson_set_gate(struct clk *clk, bool on) struct meson_clk *priv = dev_get_priv(clk->dev); struct meson_gate *gate; - if (clk->id >= ARRAY_SIZE(gates)) - return -ENOENT; - gate = &gates[clk->id]; - if (gate->reg == 0) - return 0; - regmap_update_bits(priv->map, gate->reg, BIT(gate->bit), on ? BIT(gate->bit) : 0); @@ -63,9 +57,18 @@ static int meson_clk_probe(struct udevice *dev) return 0; } +static int meson_clk_request(struct clk *clk) +{ + if (clk->id >= ARRAY_SIZE(gates)) + return -ENOENT; + + return 0; +} + static struct clk_ops meson_clk_ops = { .disable = meson_clk_disable, .enable = meson_clk_enable, + .request = meson_clk_request, }; static const struct udevice_id meson_clk_ids[] = { -- 2.30.2