From patchwork Wed Mar 29 10:09:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 668762 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 C764AC74A5B for ; Wed, 29 Mar 2023 10:10:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231192AbjC2KKL (ORCPT ); Wed, 29 Mar 2023 06:10:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231519AbjC2KKD (ORCPT ); Wed, 29 Mar 2023 06:10:03 -0400 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2816A44A2; Wed, 29 Mar 2023 03:10:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1680084602; x=1711620602; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=r323+DQEI8BsS8jV9Pe4FLB/ceIhXeIT8ZS/n2SUNiA=; b=TPq8izFMF7TkJ/EwbgCjeto8i9HZMNfMEvEYA/Zo28nwr6JYyZ47eMTY 4dOwegoqjOEUcehztCGQo2z//aRJjgVRQFv/GTYaboEyRcsR1/xekLnYt XSwaV3chKN2mVRY24SOvns8lgpdJiWySTmuBGxCc9kVa3O2wRnShoSh3j QGLo92bRaZtOGfuZrJGD6tNiqI+blBvdAQQsKa4afKO7CnK19QA76GZqw WDP+Ne50pXsKt+MhZw+aqmjtvToVC27EAw4m0NGput+rcAEQcIm8I+d+I 3WYRPclOP1274Q3+zWxUA5d114NpSddxvEiE+DaRIaMX/RroM4bM8YNG9 w==; X-IronPort-AV: E=McAfee;i="6600,9927,10663"; a="343256234" X-IronPort-AV: E=Sophos;i="5.98,300,1673942400"; d="scan'208";a="343256234" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Mar 2023 03:10:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10663"; a="773517716" X-IronPort-AV: E=Sophos;i="5.98,300,1673942400"; d="scan'208";a="773517716" 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; 29 Mar 2023 03:09:59 -0700 Received: from svinhufvud.ger.corp.intel.com (localhost [IPv6:::1]) by kekkonen.fi.intel.com (Postfix) with ESMTP id 400E6122809; Wed, 29 Mar 2023 13:09:56 +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 v8 04/10] device property: Add SOFTWARE_NODE() macro for defining software nodes Date: Wed, 29 Mar 2023 13:09:45 +0300 Message-Id: <20230329100951.1522322-5-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230329100951.1522322-1-sakari.ailus@linux.intel.com> References: <20230329100951.1522322-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 0a29db15ff34..b2562f512c49 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);