From patchwork Tue Mar 28 10:01:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 13190802 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 442C7C77B74 for ; Tue, 28 Mar 2023 10:03:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231757AbjC1KCl (ORCPT ); Tue, 28 Mar 2023 06:02:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232832AbjC1KCM (ORCPT ); Tue, 28 Mar 2023 06:02:12 -0400 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 354BA55B8; Tue, 28 Mar 2023 03:02:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1679997731; x=1711533731; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=nQjAfaD5hKwVtKx91g9YmLGgoqW2l5NzACGAL0F8b40=; b=RHT90DIKgSefp1atwBeGNwzu4Pw0rWmWMbWNS/WEBNL0GnuoSRX9DvHP hs60LMRQ/3IomfhZ8ayYwullgrHk9Pglq7F+7nti+Wto4lkebnjN8/VVG RF+i3zEHGNZjK8TD0kBADYPmaXj6F+VlwgI3zh+8nRW4D1zclMkMD56gy y3bUwuPMRZK3NJ4yxZpv5Jz001gKJJxrKLoKIJJGUlsQ3/VFeDB+4HrzU zZXLNXlWN6mWY0ONR3bz/bfTYynIm37ZyDXEk+VuiHpAzIyr5TJ38wtsB 29CJVeP0t2QRbsCBD1SoOs5Ro6He/e0S9afeZ37nTAi4hncuISxhIRLZG g==; X-IronPort-AV: E=McAfee;i="6600,9927,10662"; a="324419996" X-IronPort-AV: E=Sophos;i="5.98,297,1673942400"; d="scan'208";a="324419996" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Mar 2023 03:02:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10662"; a="753078522" X-IronPort-AV: E=Sophos;i="5.98,297,1673942400"; d="scan'208";a="753078522" Received: from turnipsi.fi.intel.com (HELO kekkonen.fi.intel.com) ([10.237.72.44]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Mar 2023 03:02:06 -0700 Received: from svinhufvud.ger.corp.intel.com (localhost [IPv6:::1]) by kekkonen.fi.intel.com (Postfix) with ESMTP id D4DF81224A7; Tue, 28 Mar 2023 13:02:03 +0300 (EEST) 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 v6 04/10] device property: Add SOFTWARE_NODE() macro for defining software nodes Date: Tue, 28 Mar 2023 13:01:52 +0300 Message-Id: <20230328100159.1457160-5-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230328100159.1457160-1-sakari.ailus@linux.intel.com> References: <20230328100159.1457160-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 37179e3abad5..6745a86bc9b9 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);