From patchwork Wed Jan 25 22:40:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 13116371 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 67A0EC54E94 for ; Wed, 25 Jan 2023 22:41:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235331AbjAYWlY (ORCPT ); Wed, 25 Jan 2023 17:41:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44216 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235174AbjAYWlW (ORCPT ); Wed, 25 Jan 2023 17:41:22 -0500 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79B785A830; Wed, 25 Jan 2023 14:41:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1674686480; x=1706222480; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=4Omzh3EBkFsKkaEjSu30BIFaElbuCTq5BekfLAtiEko=; b=VhJEdj7jfE1fxq6s2DlXt8lWvcQG9VoBO6EhOMTcGBHfqNqvmsDTHDeR rCxr0bq566/7XKEkLRlOJp843jvTgzaANY8wDTR7dHtbukIaPfZFxmX9v xxM1LuYz4IINnoc3hsYZM1fwmzmgXMzMRWHr2PSxl4/QSAfjj/vkdIuZZ Abk6Ar605y216vwR4xiLWBvxBB6ijRjVJVIKJUfkMCSj7Uvu87iwQV/G/ uokW0yqRlSr+KJ21dQrbYhdyU9IyrLkONf51cPtVUUam9YxOaQsjJJ2O0 rp4s10hlgeQ1zkpDwBTfym10AcHHRMagze5jHOu/nduWDcVaQ/twfiALw w==; X-IronPort-AV: E=McAfee;i="6500,9779,10601"; a="389040007" X-IronPort-AV: E=Sophos;i="5.97,246,1669104000"; d="scan'208";a="389040007" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jan 2023 14:41:18 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10601"; a="786604543" X-IronPort-AV: E=Sophos;i="5.97,246,1669104000"; d="scan'208";a="786604543" Received: from turnipsi.fi.intel.com (HELO kekkonen.fi.intel.com) ([10.237.72.44]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jan 2023 14:41:16 -0800 Received: from punajuuri.localdomain (punajuuri.localdomain [192.168.240.130]) by kekkonen.fi.intel.com (Postfix) with ESMTP id 4A01C122647; Thu, 26 Jan 2023 00:41:14 +0200 (EET) Received: from sailus by punajuuri.localdomain with local (Exim 4.94.2) (envelope-from ) id 1pKoS7-001gPO-9b; Thu, 26 Jan 2023 00:41:11 +0200 From: Sakari Ailus To: linux-acpi@vger.kernel.org Cc: linux-media@vger.kernel.org, rafael@kernel.org, andriy.shevchenko@linux.intel.com, heikki.krogerus@linux.intel.com Subject: [PATCH v3 3/8] device property: Add SOFTWARE_NODE() macro for defining software nodes Date: Thu, 26 Jan 2023 00:40:56 +0200 Message-Id: <20230125224101.401285-4-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230125224101.401285-1-sakari.ailus@linux.intel.com> References: <20230125224101.401285-1-sakari.ailus@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org 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 --- include/linux/property.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/linux/property.h b/include/linux/property.h index 37179e3abad5c..6745a86bc9b97 100644 --- a/include/linux/property.h +++ b/include/linux/property.h @@ -477,6 +477,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);