From patchwork Wed May 24 11:45:38 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: 98458 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2791446vqo; Wed, 24 May 2023 05:04:22 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4hHou0y2ff5WMVyPLt1D8TPqgRd/TZ6dwBTrq5ySZzHRQ09axZFPUVKjF39s/7q6V3dNeK X-Received: by 2002:a05:6a21:3293:b0:10b:7b64:706 with SMTP id yt19-20020a056a21329300b0010b7b640706mr12313092pzb.13.1684929862000; Wed, 24 May 2023 05:04:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684929861; cv=none; d=google.com; s=arc-20160816; b=dxd1T7oPol/PfblccCRu6QwUz1W8r/6nQlidr2Ntoy5Wd7ls7GWpEzerm7amgCULt2 yvf4VkBLqa+SP5sEFMIjoYRI6PJ4mmKtt/HkfVRSG5DK1Dq5uA3Fh5Yvhxzi+tZmBeYg 9Y6CEyuqs6FYjqlRdtH/aZUOeq2/5nUAdW3OM7uUhnLeIC8eU26jueIhIdkdkxCW+7h8 CC/FF6alX/PCn16CWLoU0K3WHxTjYm6Xa27Q5lVFbRXJSD93XsMqv3wp5lCJnF84Fr4e IXFv1OlQfR2sozADKtqPjLnwBga2D45hP181JRhUVnBWPBJ485U3u0GrQR0/qilNU3sK gv9w== 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=+PZZIY+v8AYmfKcYPpnCZaF5r/NFRvSyKweK/z8K9qw=; b=XEy7aYb1+67UZx+xVyiMFEHsRVzTi2oeNjPKLwFRKZQlWH/MpOGwlosrvlQsZtb/h/ MVV47J0esKJ4/TKJ1SIUQB/BpebXQomgYFIwBsoEVnXyqQfJveTzk4XjiBBPKtFDyY4z ngr2REH3rW6JtedRsxkBy6fr06Mkz0UsIn5xRNU6QzkmXADRBx8a6nV0nrr5Ibw/ha7v wFZGISVl9mu2fI0sC3HN9p/xrstde3i47Zsu2eD9/HtSDqQjIsdPgboAjWu27RpZw1xG ulU2MDoHkehGDyJlAL0+C8LVFa43EuS2zP2tyOimNt32gKXFP1Oky+qmH1E8QXtxzclb 5sIA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p15-20020a63ab0f000000b0051f17a517adsi2286388pgf.492.2023.05.24.05.04.07; Wed, 24 May 2023 05:04:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229799AbjEXLpn (ORCPT + 99 others); Wed, 24 May 2023 07:45:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229542AbjEXLpm (ORCPT ); Wed, 24 May 2023 07:45:42 -0400 Received: from cloudserver094114.home.pl (cloudserver094114.home.pl [79.96.170.134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07E31139; Wed, 24 May 2023 04:45:40 -0700 (PDT) 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 68b5a971a014d278; Wed, 24 May 2023 13:45:39 +0200 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 v370.home.net.pl (Postfix) with ESMTPSA id BA88B69D7E2; Wed, 24 May 2023 13:45:38 +0200 (CEST) From: "Rafael J. Wysocki" To: Linux ACPI , Sakari Ailus Cc: LKML , Hans de Goede , Andy Shevchenko Subject: [PATCH v1 4/6] device property: Add SOFTWARE_NODE() macro for defining software nodes Date: Wed, 24 May 2023 13:45:38 +0200 Message-ID: <3170440.5fSG56mABF@kreacher> In-Reply-To: <13276375.uLZWGnKmhe@kreacher> References: <13276375.uLZWGnKmhe@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: gggruggvucftvghtrhhoucdtuddrgedvhedrfeejhedggedvucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecujffqoffgrffnpdggtffipffknecuuegrihhlohhuthemucduhedtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufffkfgjfhgggfgtsehtufertddttdejnecuhfhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqnecuggftrfgrthhtvghrnhepfeduudeutdeugfelffduieegiedtueefledvjeegffdttefhhffhtefhleejgfetnecuffhomhgrihhnpehkvghrnhgvlhdrohhrghenucfkphepudelhedrudefiedrudelrdelgeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduleehrddufeeirdduledrleegpdhhvghlohepkhhrvggrtghhvghrrdhlohgtrghlnhgvthdpmhgrihhlfhhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqpdhnsggprhgtphhtthhopeehpdhrtghpthhtoheplhhinhhugidqrggtphhisehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepshgrkhgrrhhirdgrihhluhhssehlihhnuhigrdhinhhtvghlrdgtohhmpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohephhguvghgohgv uggvsehrvgguhhgrthdrtghomhdprhgtphhtthhopegrnhgurhhihidrshhhvghvtghhvghnkhhosehlihhnuhigrdhinhhtvghlrdgtohhm X-DCC--Metrics: v370.home.net.pl 1024; Body=5 Fuz1=5 Fuz2=5 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,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-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766777014899511866?= X-GMAIL-MSGID: =?utf-8?q?1766777014899511866?= 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 --- Same as https://patchwork.kernel.org/project/linux-acpi/patch/20230329100951.1522322-5-sakari.ailus@linux.intel.com/ --- 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 @@ -476,6 +476,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);