Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1878198lqa; Tue, 30 Apr 2024 01:43:38 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWt2Lq/w60bL86Vtdh1sMRtmgWH9NXzqutxGP+M2HTbpcNVASMstD/m4dOH5ZjdingqZHvbaOK4zYGiohvO9y1AJqdy0mZYznQZkweQwQ== X-Google-Smtp-Source: AGHT+IEy38vaY0oBnqmSrUCAy/fbd50dx5vz0jV8vXXfT4bvdzu6rfTGlPxCCjjUg3MS9lar/WFf X-Received: by 2002:a05:6214:c67:b0:6a0:ca29:1954 with SMTP id t7-20020a0562140c6700b006a0ca291954mr7801207qvj.46.1714466618492; Tue, 30 Apr 2024 01:43:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714466618; cv=pass; d=google.com; s=arc-20160816; b=h100dqBr5PSvJki2ULJNHRt92HtKM3zTXqOH05rlc2rcIyje1bJjamMgo6yI4YecnO Ux/uatNoseCtu+oWVMnvBeqT2Kyqpsc1PLlpFNqYpTx20DZ5uVdKtCrHj7cS8dw7H/g9 n57cbpxlz9TMPoi11bpdZSCVBSH3i4XxemVMWL5EwIbGuqmtCK7tySC/lJEBxXeiTL02 LyWRySlLF2RwmGX7MmJkTxHB0keaUTTIJLhzs1kWRWYr+W9sV+Xgy/cnGVuW23n5J1xc iHifM1eD/OdJFuJJ2YvrZx9/wT+m5TEweNUGXX8Ru7NJ+unrzAAQPDECPzh9EdNTM0Ts mecg== 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=HOrdL8D1Yo1+FTRkcba34oG6bd3Uzs7JBNkhgICtpjg=; fh=wLJMNfcbOxpEep4AozbD3QJkKmGbYz7NO97H9PCORXg=; b=0sm59hwMQrSQasolXt8szGKGreRlh3lPQ+jCpijB3IUM9QHNW1pPMvYhtL6IOdDbzW zj58dKjqkyRqu7znobOOscbsHAzpOOx9SbyzUVYdES3kgaypfzCiX3O4/QRCYB1jLyqk yHdR6xOUKBvbYJsV+bPnqDAb6r77TxaKC+mdfttbdkfXSOcEbsUHmAXMaVjcbrUtcTYl qsn9kc05YgeqJA2yz9LNM3SZnnwk45bK5prKN+OgKugB5/corPYQalU/vD1k7arHK9Xd j/VKVGGUCrcOq04KjFYvtwaN+ZVoT7tCm/BUzovF/TtrI4v9g+d772ptBeKOZ/zsZYos NozQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=F7kImKJ0; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-163564-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-163564-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id pn10-20020a056214130a00b0069945f437adsi28377294qvb.9.2024.04.30.01.43.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 01:43:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-163564-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=F7kImKJ0; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-163564-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-163564-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com 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 5F6291C22B27 for ; Tue, 30 Apr 2024 08:43:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E8388128379; Tue, 30 Apr 2024 08:39:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="F7kImKJ0" Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) (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 B025A1BED87; Tue, 30 Apr 2024 08:39:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.200 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714466376; cv=none; b=b26/H7qQB51ZZ53ROpz6PPN0fROx3kxLATFNIpnj5xfEuT+/w4WxOC7uUsVhCKxKv30QF4b5R62gKusZYLkHqcfcvn3Q4ptvNF8ncuhjc0VtN8oiKaDeW1ISzRgeGEg+5KKCuMDjYCNWf0dbORHtQSx4Z8GsWYWwhNQdn4LPj2k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714466376; c=relaxed/simple; bh=QZpvZsfKgX3F8oDhD1XKg83UlmJnd2VYkZjW6DQVGU0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=j4RleFKudDKe/Nkh7LvVoqKgReMgPpAYsJgs5ZX6rSk+Dsz7riYoKl0ESollgr0lpwBf2UMjqTHpeAVQ9tax26gYyYvJ2ZPrth7FPO4KnAhGPFKLJdIAAEONDVzFrlWPNRO7EwUckOtrnm4VnfENgr+p1pKJTf/iOskHfUVXnaU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=F7kImKJ0; arc=none smtp.client-ip=217.70.183.200 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPA id 8EF7C2000F; Tue, 30 Apr 2024 08:39:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1714466372; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HOrdL8D1Yo1+FTRkcba34oG6bd3Uzs7JBNkhgICtpjg=; b=F7kImKJ0zmG8XOjLM+GJ3WGHJg94BRx9PKzFcwJtvbab1UExnVPJ2t0MEJyrQ2BBifkU68 HeUwQkBVa6NFUWChkprKxl7x4daH0239zjzr7iW1Oq+xiZRl7NmoMbkfPF3p2PX0a2cPvt 5hx/A/9725qGixJZbfHadeDiLoO3uR8wxKPr2+gXTKnddSnpb1JIbcbQj0KL/KGzLCaodc jhM5ig5JcSyahH/y9bRSct+7j9YPbbit16TsKCznxOvvOQsGMOdyr1nbjUuHVP6IPgc/iE 5XUcWe5r+J0D10Id0dSE1a26F4lUj3D5caTy51zcfxrLsuU6dKX6b/UVUTcxsQ== From: Herve Codina To: Herve Codina , Thomas Gleixner , Rob Herring , Krzysztof Kozlowski , Conor Dooley , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Lee Jones , Arnd Bergmann , Horatiu Vultur , UNGLinuxDriver@microchip.com, Andrew Lunn , Heiner Kallweit , Russell King , Saravana Kannan , Bjorn Helgaas , Philipp Zabel , Lars Povlsen , Steen Hegelund , Daniel Machon , Alexandre Belloni Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, netdev@vger.kernel.org, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Allan Nielsen , Steen Hegelund , Luca Ceresoli , Thomas Petazzoni Subject: [PATCH 14/17] of: dynamic: Introduce of_changeset_add_prop_bool() Date: Tue, 30 Apr 2024 10:37:23 +0200 Message-ID: <20240430083730.134918-15-herve.codina@bootlin.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240430083730.134918-1-herve.codina@bootlin.com> References: <20240430083730.134918-1-herve.codina@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-GND-Sasl: herve.codina@bootlin.com APIs to add some properties in a changeset exist but nothing to add a DT boolean property (i.e. a property without any values). Fill this lack with of_changeset_add_prop_bool(). Signed-off-by: Herve Codina --- drivers/of/dynamic.c | 25 +++++++++++++++++++++++++ include/linux/of.h | 3 +++ 2 files changed, 28 insertions(+) diff --git a/drivers/of/dynamic.c b/drivers/of/dynamic.c index 4d57a4e34105..37d3b0a272dc 100644 --- a/drivers/of/dynamic.c +++ b/drivers/of/dynamic.c @@ -1052,3 +1052,28 @@ int of_changeset_add_prop_u32_array(struct of_changeset *ocs, return ret; } EXPORT_SYMBOL_GPL(of_changeset_add_prop_u32_array); + +/** + * of_changeset_add_prop_bool - Add a boolean property (i.e. a property without + * any values) to a changeset. + * + * @ocs: changeset pointer + * @np: device node pointer + * @prop_name: name of the property to be added + * + * Create a boolean property and add it to a changeset. + * + * Return: 0 on success, a negative error value in case of an error. + */ +int of_changeset_add_prop_bool(struct of_changeset *ocs, struct device_node *np, + const char *prop_name) +{ + struct property prop; + + prop.name = (char *)prop_name; + prop.length = 0; + prop.value = NULL; + + return of_changeset_add_prop_helper(ocs, np, &prop); +} +EXPORT_SYMBOL_GPL(of_changeset_add_prop_bool); diff --git a/include/linux/of.h b/include/linux/of.h index a0bedd038a05..9633199a954a 100644 --- a/include/linux/of.h +++ b/include/linux/of.h @@ -1652,6 +1652,9 @@ static inline int of_changeset_add_prop_u32(struct of_changeset *ocs, return of_changeset_add_prop_u32_array(ocs, np, prop_name, &val, 1); } +int of_changeset_add_prop_bool(struct of_changeset *ocs, struct device_node *np, + const char *prop_name); + #else /* CONFIG_OF_DYNAMIC */ static inline int of_reconfig_notifier_register(struct notifier_block *nb) { -- 2.44.0