Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2580130lqp; Mon, 25 Mar 2024 03:24:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVnqKZPM2nj6eqlMwKD9/0kXwxckL0ezXg7t1fMs8nSZ2ffz+dzJ6GOHuRoT1Jn3AZlsGg/jKMIMD8R3kWFxA0Zr2HwbhxOFpRFVSyw7A== X-Google-Smtp-Source: AGHT+IFVySFCS2ivRl6iP+qJlujEsjGIqIfB/W1qDNDZNsUMIbo530UNNmGl1bTjUt+gbi6BKk1S X-Received: by 2002:a50:8a98:0:b0:56b:cf26:3af0 with SMTP id j24-20020a508a98000000b0056bcf263af0mr4684343edj.17.1711362242183; Mon, 25 Mar 2024 03:24:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711362242; cv=pass; d=google.com; s=arc-20160816; b=tif7Bki3Ttbg9vIcB+cwI0/qU58bIOvyuPb3nShbWXw3OcMR+iSEEe6uYRVH8eTDHG Bzh0TAv2WkrsJYIfjfQMSUlBhHKY0uZSXCQo7k2QT4/7o7X85RcGUTYUOhqOBa4XHjCz SEL8IBG/kqC5wVpvEBIjBuS4ivHN7DUiU1HJhjyzZrQUL/YQV/0zQKhONwZ9WktjsF41 NNPvrD1ZWSTw7ayROWUmNQbgqHiSm+/LzxEUMZMH531sm1EYGREspdDqgmW2bzMNe0uK F+reEhaHGNYZY/8qAaA0OLDxheAmkhOUmXDgh7zcAiv63/jIWL0ll4OcxOShEbNVGkaA eEvQ== 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=MudKIHp7xNQ6CAPJd3Np/3z0h/kZIR3g6xkb1vnIXMYa2En1KdCAv5+7bM0QMpx4KS GgkP1UcOPKHMcAKKz9qUcfbihAa2ufySYr81Bd5fJJGdEF8QiL10DLp1i67p7LoKpd1W Kvlq8dBepomS3AtRSC8QwtL0YwS0REfJCyfzf7KAIyzbKm1pjbR4pD6/U2qHgQAc4ouj Y4B2/hpG83rehxZMTzQTc2LhTmJxfsmCtCcbuoU95FO14bZ1BVcOQzocezYUVie+Su8m K/PGqv5THG8ZnIjEkhO7V5d/aDZlJdPtH4d7aXbCNM8lpYNDzUhk+MIyYfC0kpWqAkJr yQcQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=l1ljm1ou; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-116179-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-116179-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id g7-20020a0564021ec700b0056893d784f7si2452237edg.52.2024.03.25.03.24.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 03:24:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-116179-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=l1ljm1ou; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-116179-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-116179-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 am.mirrors.kernel.org (Postfix) with ESMTPS id DD78B1F2A1F0 for ; Mon, 25 Mar 2024 10:24:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C8E893B7F18; Mon, 25 Mar 2024 03:33:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="l1ljm1ou" 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 7EFA217C1AC; Sun, 24 Mar 2024 23:42:42 +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=1711323762; cv=none; b=P5K/vTXI3qNNxcLYH4bOB5W9sh2SvCOKL0Zb5lqqflMiEwiOQXEOdq1Yxc9lxY/hflL+5e9lpJf4P1+8paNzLKt9NaFJlhb2/ot0nCQ0uoRVIyWSDzrgIua8WM2FzW+ErRHrRcJ8OLLcXRMwOSVxIq2M3q6ng521OIMHl3LXt8I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711323762; c=relaxed/simple; bh=uIDSKaGEKevri4m+701P4fwqcj5BZkuhrTLKSp6QbB8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fY9d7MuLAmVuH4l9EWzt//wFWl8yQtLmc7/KaR3m7aW7DSTwUWZKQ6P3QS6TginTgoTQbw4TIzS9/X46hdfLsHEmxSQvwNzalcH3Qcmeq2xdyyOg3nozLjoTkKS4on1DPFfA6v4SqW9BPt+DPnk9EvMXKC7BJ4Giu24Wxqtxqxo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=l1ljm1ou; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id AA850C433C7; Sun, 24 Mar 2024 23:42:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711323762; bh=uIDSKaGEKevri4m+701P4fwqcj5BZkuhrTLKSp6QbB8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l1ljm1ouMtN0l3hyUpyA635vgThspR333XAgRIBT7mBl1GEeR2CUnFv/hGHlZGIjS LgNfEn7dA3u+rifoG7PAwYFlI4HEXCA0q6bpusRccqxOM7O02Fa1y0V4PprIiEelyT 70+IYgg+ES8FUrGyvTjKXHBaBkVeLJH6oWPhqAQtboujAFd1EpRcl9Z/BuoRUu5/7s lr5wf62/HEQYmxumKlhOgSaKV+Q+hDIy2UiQHDqS8zzIxxfc6ef6MH0TGr4gQq8jls X6nI3FPYbyRXD2DW2IgZKs7wGcNziTEcZoZxuvXDLoNZiJXnHdrpfFM4mzHxu4J1rf p/IVvoAcuGD3Q== 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 5.10 137/238] clk: qcom: reset: Commonize the de/assert functions Date: Sun, 24 Mar 2024 19:38:45 -0400 Message-ID: <20240324234027.1354210-138-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324234027.1354210-1-sashal@kernel.org> References: <20240324234027.1354210-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