From patchwork Wed Feb 8 21:27:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 652022 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 86331C636D6 for ; Wed, 8 Feb 2023 21:27:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231641AbjBHV1y (ORCPT ); Wed, 8 Feb 2023 16:27:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231490AbjBHV1x (ORCPT ); Wed, 8 Feb 2023 16:27:53 -0500 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E0461C7DB; Wed, 8 Feb 2023 13:27:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675891673; x=1707427673; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=4Omzh3EBkFsKkaEjSu30BIFaElbuCTq5BekfLAtiEko=; b=k3IitpGLQuuENP62H3hDzsW6Fwpl9/UBG2+el0x3A+wFMNb0Qvn/6cUf 34UFOMfUOHuW7mehtn628Gb2x54HG+11o86HfKXhG/F8n02nkhY61hoeT NrqD5JQH+1dnrmVvKo6tV6RfyUr37g2fOql5pc+AfTYC7AicxJyZ+K7H0 AKKw4qj4ZxhT1r+U4nBFm/qMOI3QgdNfq+TEQBTXcIrpx400FpOj7F5rr mkHalSXzUMKKwKc639JkyFrOzLOm0nbllyu4kH2TLks9GSmvGBy5ZIJbF TnkgFVG0Txj9C0m+xaHxkjTUEYgGlsVvxrJK8k77AesKWumQqpAijDfBx g==; X-IronPort-AV: E=McAfee;i="6500,9779,10615"; a="313566169" X-IronPort-AV: E=Sophos;i="5.97,281,1669104000"; d="scan'208";a="313566169" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2023 13:27:51 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10615"; a="756180456" X-IronPort-AV: E=Sophos;i="5.97,281,1669104000"; d="scan'208";a="756180456" Received: from turnipsi.fi.intel.com (HELO kekkonen.fi.intel.com) ([10.237.72.44]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2023 13:27:49 -0800 Received: from punajuuri.localdomain (punajuuri.localdomain [192.168.240.130]) by kekkonen.fi.intel.com (Postfix) with ESMTP id B619C122811; Wed, 8 Feb 2023 23:27:47 +0200 (EET) Received: from sailus by punajuuri.localdomain with local (Exim 4.94.2) (envelope-from ) id 1pPryM-00DMZG-Qi; Wed, 08 Feb 2023 23:27:22 +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 v5 3/8] device property: Add SOFTWARE_NODE() macro for defining software nodes Date: Wed, 8 Feb 2023 23:27:07 +0200 Message-Id: <20230208212712.3184953-4-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230208212712.3184953-1-sakari.ailus@linux.intel.com> References: <20230208212712.3184953-1-sakari.ailus@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@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);