From patchwork Mon Nov 6 16:16:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rafael J. Wysocki" X-Patchwork-Id: 162076 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp2777942vqu; Mon, 6 Nov 2023 08:31:52 -0800 (PST) X-Google-Smtp-Source: AGHT+IFcYiM4P7ChED+TU1Qogx7XUp9o+eOO8+l9KgQjaH7f9Er1uFeXmioKt18jU5AbkWEkZDaM X-Received: by 2002:a05:6871:610b:b0:1e9:94c1:9179 with SMTP id ra11-20020a056871610b00b001e994c19179mr201841oab.21.1699288312017; Mon, 06 Nov 2023 08:31:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699288312; cv=none; d=google.com; s=arc-20160816; b=KnKlgJsDqGZWFaDtpldPuojuH3sHaMs7kT3fDxYn0niJXQWG+HuDhUXUS9cT+31CaT KTqgzuADq3cXYhGH/yy+wwmliHejFATfLoDBjyfm9mivUgfDYKFSqHaKXluDEn1S8DDt 8dBP+cTmQe2w45snKCYjn4EsSunF8NvsYyg4Ln87AA5MDbdXz8dalsiOGy36Bk6dPPKJ WDfl9nXn4bMvXIxFvie5bOzcpgToV4nIT6l6hddzFt5I9kQi9hC7CH2RiD9csTuwPgb1 fZW6GJQoT7hZBspWEshR2J5nft4655wkA4dOAQEy99ueCF9Ku/nQlR8hG8qwUqKjq6bE /OFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=tTRUPhgn50cPF1mkKLJ8EfTysyrltnyEUf71vv2jdHs=; fh=WaqwKbNI6ggyvaUQ85iAclRCevgklJhqArlb3px6pNU=; b=xLY1xdfeBxsfHoh/SwdqouCEasTSA04engx8cWFQH7WVP7JVpb07d2SYdXEYPEcLqE LpFBdaTlKoMextzpSMtABXj5AvEG1/qT8pb2HUOEqWlsAmZUOWvKBOjkKylEg7gsMDag tIkQ3lOwlQePBJKFCIkjO/0DiX8+SCKCexoVM0cOA8TM1fhwzu6cfTqxZ/ybAreC7fyC BupJEajeJM41wKaFmbZ5Yf3Sq1C8Xwwig579X08Dpa9I3Gaei7JYoum34IorNx94qhrz 50vVLwkaGudVwrSLyGg8v5HrseVh/YKuPKpY/WK4INpGx4yabLVXCSUjP7MLlYuvj6eB ya0w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id tc3-20020a056871870300b001e978d19d26si3051824oab.273.2023.11.06.08.31.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 08:31:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id BE03C8025729; Mon, 6 Nov 2023 08:31:50 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232801AbjKFQbn (ORCPT + 35 others); Mon, 6 Nov 2023 11:31:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232094AbjKFQbj (ORCPT ); Mon, 6 Nov 2023 11:31:39 -0500 Received: from cloudserver094114.home.pl (cloudserver094114.home.pl [79.96.170.134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9FE92D47; Mon, 6 Nov 2023 08:31:36 -0800 (PST) Received: from localhost (127.0.0.1) (HELO v370.home.net.pl) by /usr/run/smtp (/usr/run/postfix/private/idea_relay_lmtp) via UNIX with SMTP (IdeaSmtpServer 5.2.0) id 221b211dc1a76a6e; Mon, 6 Nov 2023 17:31:35 +0100 Received: from kreacher.localnet (unknown [195.136.19.94]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by cloudserver094114.home.pl (Postfix) with ESMTPSA id B361B667790; Mon, 6 Nov 2023 17:31:34 +0100 (CET) From: "Rafael J. Wysocki" To: Linux ACPI , Sakari Ailus Cc: LKML Subject: [PATCH v3 4/7] device property: Add SOFTWARE_NODE() macro for defining software nodes Date: Mon, 06 Nov 2023 17:16:37 +0100 Message-ID: <3211372.5fSG56mABF@kreacher> In-Reply-To: <4542595.LvFx2qVVIh@kreacher> References: <4542595.LvFx2qVVIh@kreacher> MIME-Version: 1.0 X-CLIENT-IP: 195.136.19.94 X-CLIENT-HOSTNAME: 195.136.19.94 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedruddugedgkeejucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecujffqoffgrffnpdggtffipffknecuuegrihhlohhuthemucduhedtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufffkfgjfhgggfgtsehtufertddttdejnecuhfhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqnecuggftrfgrthhtvghrnhepvdffueeitdfgvddtudegueejtdffteetgeefkeffvdeftddttdeuhfegfedvjefhnecukfhppeduleehrddufeeirdduledrleegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepudelhedrudefiedrudelrdelgedphhgvlhhopehkrhgvrggthhgvrhdrlhhotggrlhhnvghtpdhmrghilhhfrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqedpnhgspghrtghpthhtohepfedprhgtphhtthhopehlihhnuhigqdgrtghpihesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehsrghkrghrihdrrghilhhusheslhhinhhugidrihhnthgvlhdrtghomhdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrgh X-DCC--Metrics: v370.home.net.pl 1024; Body=3 Fuz1=3 Fuz2=3 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 06 Nov 2023 08:31:50 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781832940974910138 X-GMAIL-MSGID: 1781832940974910138 From: Sakari Ailus Add SOFTWARE_NODE() macro in order to make defining software nodes look nicer. This is analogous to different PROPERTY_ENTRY_*() macros for defining properties. Signed-off-by: Sakari Ailus Reviewed-by: Andy Shevchenko Reviewed-by: Heikki Krogerus --- v2 -> v3: No changes --- include/linux/property.h | 7 +++++++ 1 file changed, 7 insertions(+) Index: linux-pm/include/linux/property.h =================================================================== --- linux-pm.orig/include/linux/property.h +++ linux-pm/include/linux/property.h @@ -488,6 +488,13 @@ struct software_node { const struct property_entry *properties; }; +#define SOFTWARE_NODE(_name_, _properties_, _parent_) \ + (struct software_node) { \ + .name = _name_, \ + .properties = _properties_, \ + .parent = _parent_, \ + } + bool is_software_node(const struct fwnode_handle *fwnode); const struct software_node * to_software_node(const struct fwnode_handle *fwnode);