Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp333071rdb; Mon, 29 Jan 2024 03:58:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IGgHDKWVDXO62a/GhyN05mKjBi/TFEsOv5YRTTegIitydp52Zn7R9b5byRfNncFWYOPPEiP X-Received: by 2002:a17:903:191:b0:1d5:ee41:77b0 with SMTP id z17-20020a170903019100b001d5ee4177b0mr6691318plg.15.1706529492355; Mon, 29 Jan 2024 03:58:12 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706529492; cv=pass; d=google.com; s=arc-20160816; b=iopSKoDgI36Hjr40foluB5f8tBJ1a/6R6q4QJSK4TJTeg5tqtHUz8uI8lKRfEPQTbs LFHUK14JjrJVFs5sPcjyz4n8Jkb23f+pYsYwhrll/6ONIuw4lYqAp0BOAoOD8X9e73fV ea+mCG5jD64uqSwHqII44w3fAl1zgQciKd2vQgbE8kNWJlOEA3jYT6wHsvA8DkWdI9ox 4thNjWPpF+cmUCK657kRvCxcU2T+ZaOKgZmqHOnoP44Ctbd3N2JqtL370DIVXgPIcp0g Gib0CJiMF6xh70j9iyDTbnEuW4VU8HdeZOLuM085p+QJCw+eM5NeNl1KfKaAhUAiBVlk WrDw== 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=7u11vGwKEs3fH7gtNpJv3ew33Q7fXCEnCXNY0GONseQ=; fh=fFm2K8VcB+7rgMRllZR/p+J69hkVshGdMfAgQKU9hhQ=; b=c1+R87aHuISbY9czsPmCBweZeTysMUxjlVovx5GbyqVQYpdcWU7Pb2LCS3fbLIXDN6 3sh3AUNMboEF7ldcwK3DdfFR+2QzTeek69au/X9ZTxDvjID7CafbwGcNy8eXtS6mCLcb c3XNMZXDEwtk6cRmQqHlfiYm4s66HtResBFnbu1RrsX9QOvvMFPxhqR6ixFk19VFzxHl niHIPuwYjR9tzuW3V6YLcBdKUXs9fePEcYxtFumALtJ+Bks9mL+H8abptihmehGc7zto peWkKTQqpSaNKfIkLeZSK869HpbC8HIqSBud7Mx8OHSDrYsY+H1HyRBlRSHvVyL1DT+/ s2iw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yh56MIvr; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-42639-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-42639-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id j15-20020a170903024f00b001d5f4f13bd1si5609954plh.368.2024.01.29.03.58.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 03:58:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-42639-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yh56MIvr; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-42639-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-42639-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 7830AB234CB for ; Mon, 29 Jan 2024 11:52:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6244A604A9; Mon, 29 Jan 2024 11:52:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="yh56MIvr" Received: from mail-ed1-f45.google.com (mail-ed1-f45.google.com [209.85.208.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4D09F5D8FE for ; Mon, 29 Jan 2024 11:52:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706529147; cv=none; b=oNq9JrslCWUNsBBrhMP9zlAcWstrjuH4/PejigdFBuzrnEaT1HUW0o4HXN1r4EFExsCOm9uVRyhgEB6Dh2PLq4lbV4c4ukWbdUszhop7MQih1uEbmfTAA8OzgNlnWsg3xqOKW6nDMuJ9YwLReiwSkuzAZX1rCDEYIEd7SoKf1J0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706529147; c=relaxed/simple; bh=pEaaZzWd53CrhjsWjih79Gm0lLf84UYwD3xSD5zEQj4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Fy39xIWdtJNk/fZLxuXQZQeuM9cREmq/AxaLVUCrCEq8xCegVxex8EEGXzLyhX/msdtdDb4REiDO+Mirg+GRX3ZeXAuxTlhwdcs5UCBqgTB7YaUY2mXhu9oHeKacuYWcum+GpczlKJp0oIsvZBtA5gqeBj5WTWjQ++VHLtQEZSc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=yh56MIvr; arc=none smtp.client-ip=209.85.208.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ed1-f45.google.com with SMTP id 4fb4d7f45d1cf-55ee686b5d5so1449486a12.0 for ; Mon, 29 Jan 2024 03:52:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706529142; x=1707133942; darn=vger.kernel.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=7u11vGwKEs3fH7gtNpJv3ew33Q7fXCEnCXNY0GONseQ=; b=yh56MIvrIsDDIDVRv+XbFPR1vq7DFcZr2EVOcMGSm8H5VBpT+4FLwgMKgbreCl94KO 4+kllBcnF8Tsd/Z7TOsH5z8zzbD4FWMfWiNXja/DLdcEfku4uvC0ldYaRIsBQnfo1Gy/ 5nzJdHCiRfZ8vXCkwv5QuKhz89AoZ7KLKzGn857jrjih/EOfLQ4MUeCUWhasUfvDSPvb NsdAVSnnjVHjTVwyl6Aj7h8JFbeUGv9hEBae0urfW90XUQ/Pc7ybAZ2EYeqcBh5WH0rc BUxLbc5/yWEZNypMX3EM3sF5x48DAMh74kk8wLIxuESZlSgOetYf92PXnYlJHC7sGQp4 sVmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706529142; x=1707133942; 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=7u11vGwKEs3fH7gtNpJv3ew33Q7fXCEnCXNY0GONseQ=; b=iYOpEXKezwSUcnmg/KfPQFlxwnsA0oZZER17bmT94j0UZtlUa5fgcyswqja4LiibTr m7vvF1VI+yKNgxrcg/LBr8sJ6OE/BntClwpF0SeAUgygx9O13BXyQWWEZ3z8HFkfGpn6 77DKt6hK2kq7gBvUOZLKgz42h15/kbvVQMR5lIUxe8henbG0TtREaKMpRDxoFD6lf47A Eex9st56u/xDcjuKyFfM+bCHG3wiJkdR/l5lvYjpUrsfZoJ9QC75YEtt26fji2XLmsuN CKQyTU/Xh19CwhnNygZqmSBmg7f7DEjvRciuLxaXFwwA9CZBGdDV2MIrxsPV0izWkO3V dxag== X-Gm-Message-State: AOJu0YzLT9tzzki1vRUqVShGO8vwHPbj7o1h+OwapeFPBsFWzio4ZTCk /Iajo/2j9IZ7/5yXBL38al9L5YjX/gx85dRLEsXbSFG7iRxwDADQhJgveZJUACM= X-Received: by 2002:a05:6402:274b:b0:55e:f866:30dd with SMTP id z11-20020a056402274b00b0055ef86630ddmr2119525edd.12.1706529142419; Mon, 29 Jan 2024 03:52:22 -0800 (PST) Received: from krzk-bin.. ([178.197.222.62]) by smtp.gmail.com with ESMTPSA id ec19-20020a0564020d5300b0055f29ececeasm19907edb.57.2024.01.29.03.52.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 03:52:21 -0800 (PST) From: Krzysztof Kozlowski To: Srinivas Kandagatla , Banajit Goswami , Bjorn Andersson , Konrad Dybcio , Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Philipp Zabel , "Rafael J. Wysocki" , Viresh Kumar , Frank Rowand , Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org, linux-arm-msm@vger.kernel.org, linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Cc: Krzysztof Kozlowski , Rob Herring Subject: [PATCH v6 1/6] of: Add of_phandle_args_equal() helper Date: Mon, 29 Jan 2024 12:52:11 +0100 Message-Id: <20240129115216.96479-2-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240129115216.96479-1-krzysztof.kozlowski@linaro.org> References: <20240129115216.96479-1-krzysztof.kozlowski@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Add a helper comparing two "struct of_phandle_args" to avoid reinventing the wheel. Reviewed-by: Philipp Zabel Acked-by: Rob Herring Signed-off-by: Krzysztof Kozlowski --- Dependency of cpufreq and reset change. --- include/linux/of.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/include/linux/of.h b/include/linux/of.h index 6a9ddf20e79a..85bcc05b278d 100644 --- a/include/linux/of.h +++ b/include/linux/of.h @@ -1065,6 +1065,22 @@ static inline int of_parse_phandle_with_optional_args(const struct device_node * 0, index, out_args); } +/** + * of_phandle_args_equal() - Compare two of_phandle_args + * @a1: First of_phandle_args to compare + * @a2: Second of_phandle_args to compare + * + * Return: True if a1 and a2 are the same (same node pointer, same phandle + * args), false otherwise. + */ +static inline bool of_phandle_args_equal(const struct of_phandle_args *a1, + const struct of_phandle_args *a2) +{ + return a1->np == a2->np && + a1->args_count == a2->args_count && + !memcmp(a1->args, a2->args, sizeof(a1->args[0]) * a1->args_count); +} + /** * of_property_count_u8_elems - Count the number of u8 elements in a property * -- 2.34.1