Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2384317lqp; Sun, 24 Mar 2024 17:03:14 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWnrB+8t9Y51d2qJTCI2khUN/LgsZvlEDXzNUVw2nny30AhYkvyYFGb/ZLjt/++RkHx357BY3mx6LyI+WjqvIqRQ924Sypton/dfJXniQ== X-Google-Smtp-Source: AGHT+IERxl7jMQf/pkPmFoimPFsdkiWfQyeHVGv8F4onGjJvIYKp4g5YbTkv/sZJ+FgQPjQzRzgM X-Received: by 2002:a05:620a:565a:b0:78a:3ad0:9920 with SMTP id vw26-20020a05620a565a00b0078a3ad09920mr6068168qkn.34.1711324994105; Sun, 24 Mar 2024 17:03:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711324994; cv=pass; d=google.com; s=arc-20160816; b=Bf73pR+J2+AJe1J15zyUi2aPKP5kizKmQGAQPDDBt2OGKkDyNcZOmDNRLo7ngSHDIy tpFP3zi+QqTzB4V7S5BaQRby8uFbNnyH5KfQRfxfoZOXbgHjRvx4YLfilhU438weryMo CnPVtaYqDygG3btKaxt2J+/d6GmE7YsR1dwdcAGuphb7v302Xj85WDYJfDu3Nvl2ue0D s99MUCDk4jS0bjc4IlO8Wb7EFzVS2lIBYy5DLIANlvtaqkigpqY3KLdoydDPwT/F8auy KsNWjCBhCECOwxNAQx2Pguqj8uQKK1Mwx/WAaF0WSQUEPAFYtPrqwzf1OltI+/9nY4iP 6mqQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=0WzsKeFWcIcNx6jWguwcLJorX3TD5tNlHX3Y119rVn8=; fh=9rgSWHcA+Bozjtrrtdm1FgsAq0um9vpUK5CPhMfKez4=; b=aXDd3sB4/u4XqIvfp18k2d9CRytKDuoLLwuATMypkA5Pz8MICp5VSwyw4uPlufrcV1 4YR+POnUphg2Sy5/1dA3yXbm3Dll0dVPBprzSQq3CkYwDoVFGbXV08otUNLij9YYO3c0 p85S37aUmOYWQa9dB/Hh3k0kWP4sdAk/tQC5NK2MVIRm7QwXLzjyVIQgcOx5Y3m5OqCF 9XCZzb3ktGBZUNfBL4fF8lovbL2mMYfZD1xQukazA3euIi96ZNVfnGVo+eeRF7Kq+eHJ btJB0Q59f2osy4Rsy+DBWvs5vj4r86HMYDM9E2e7amv1Hvr4JZN5LcEdtkmE1OBacC9E Vu6w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TTzAKVvF; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113294-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113294-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id oq10-20020a05620a610a00b0078a34e7f637si4254360qkn.282.2024.03.24.17.03.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Mar 2024 17:03:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-113294-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TTzAKVvF; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113294-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113294-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id C3DAF1C233AF for ; Mon, 25 Mar 2024 00:03:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 53A4613CD65; Sun, 24 Mar 2024 22:41:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="TTzAKVvF" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4862B13CD46; Sun, 24 Mar 2024 22:41:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320095; cv=none; b=TPug+YOic6dto/XW1AcrdUOKPiaFF0204/cXEYILcceb4AhymNqDz2jx2TALIAwmXnyTsUDpzWdU4MTTszXbLlrDNwOxstXIqUSm/dUqd3RVBN4XNjhj7kAcSrVih16iA7qkLspqiNYV/BJri8Gw9pW5TWobUwhv9YVspIUqB4o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320095; c=relaxed/simple; bh=uIDSKaGEKevri4m+701P4fwqcj5BZkuhrTLKSp6QbB8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bKKpt4KiTGO6Ni7Sj/GftldMreztY3gtEJQ96KKnT2XuIcC+Ibpi1ZpJbEKxV1xfUkoPB2xk9XPydkPjVXqUvHkslLWusLpFCD69orKwnoPvvi9Ze0SuL8UWuj60s3x/Vxe/TrwPjBWRLunJWxaouEEIxXxRHjmtncjeZYSlTfg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=TTzAKVvF; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 020F3C433B2; Sun, 24 Mar 2024 22:41:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711320094; bh=uIDSKaGEKevri4m+701P4fwqcj5BZkuhrTLKSp6QbB8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TTzAKVvFLNTWyh6oKnkDYox+o/oKnErKjKOT4bizGs0t4Mf7mX0awz7Cb1t9HFiK3 dxgLtvNs+ZNTpAASukgAqpbjwjfCQ3N4AHIBPo81nRqBf5WaWs7s2cCn2IeufjIXqH buucZFVRBCVUTrJSFuiYKLJZ8E7msVurVqQh1unMPiISssPCUmmt3gHkdATTxEtpJ6 AkNEykNmk4nwuUye7DMgvEESYsC5cnld7Z56H2X0QZ+At54cudn5hSqqRwvWMIoja0 NN1mlOs7nlVuRY0H1ICl7cqZTSi3yGrxm6+qnhMhXBpqFDrMGg/wzGEGc+f5ob9m1Q 0rJVpqmginA9w== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Konrad Dybcio , Bryan O'Donoghue , Bjorn Andersson , Sasha Levin Subject: [PATCH 6.8 403/715] clk: qcom: reset: Commonize the de/assert functions Date: Sun, 24 Mar 2024 18:29:42 -0400 Message-ID: <20240324223455.1342824-404-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324223455.1342824-1-sashal@kernel.org> References: <20240324223455.1342824-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Konrad Dybcio [ Upstream commit eda40d9c583e95e0b6ac69d2950eec10f802e0e8 ] They do the same thing, except the last argument of the last function call differs. Commonize them. Reviewed-by: Bryan O'Donoghue Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20240105-topic-venus_reset-v2-2-c37eba13b5ce@linaro.org Signed-off-by: Bjorn Andersson Stable-dep-of: 2f8cf2c3f3e3 ("clk: qcom: reset: Ensure write completion on reset de/assertion") Signed-off-by: Sasha Levin --- drivers/clk/qcom/reset.c | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/drivers/clk/qcom/reset.c b/drivers/clk/qcom/reset.c index e45e32804d2c7..20d1d35aaf229 100644 --- a/drivers/clk/qcom/reset.c +++ b/drivers/clk/qcom/reset.c @@ -22,8 +22,8 @@ static int qcom_reset(struct reset_controller_dev *rcdev, unsigned long id) return 0; } -static int -qcom_reset_assert(struct reset_controller_dev *rcdev, unsigned long id) +static int qcom_reset_set_assert(struct reset_controller_dev *rcdev, + unsigned long id, bool assert) { struct qcom_reset_controller *rst; const struct qcom_reset_map *map; @@ -33,21 +33,17 @@ qcom_reset_assert(struct reset_controller_dev *rcdev, unsigned long id) map = &rst->reset_map[id]; mask = map->bitmask ? map->bitmask : BIT(map->bit); - return regmap_update_bits(rst->regmap, map->reg, mask, mask); + return regmap_update_bits(rst->regmap, map->reg, mask, assert ? mask : 0); } -static int -qcom_reset_deassert(struct reset_controller_dev *rcdev, unsigned long id) +static int qcom_reset_assert(struct reset_controller_dev *rcdev, unsigned long id) { - struct qcom_reset_controller *rst; - const struct qcom_reset_map *map; - u32 mask; - - rst = to_qcom_reset_controller(rcdev); - map = &rst->reset_map[id]; - mask = map->bitmask ? map->bitmask : BIT(map->bit); + return qcom_reset_set_assert(rcdev, id, true); +} - return regmap_update_bits(rst->regmap, map->reg, mask, 0); +static int qcom_reset_deassert(struct reset_controller_dev *rcdev, unsigned long id) +{ + return qcom_reset_set_assert(rcdev, id, false); } const struct reset_control_ops qcom_reset_ops = { -- 2.43.0