From mboxrd@z Thu Jan 1 00:00:00 1970 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 CEFA1C05027 for ; Mon, 23 Jan 2023 14:51:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231778AbjAWOvj (ORCPT ); Mon, 23 Jan 2023 09:51:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231775AbjAWOvi (ORCPT ); Mon, 23 Jan 2023 09:51:38 -0500 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B0DAF1027A; Mon, 23 Jan 2023 06:51:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1674485497; x=1706021497; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=VBFVwFnSB+4lhqJQw2QnUrOxODVr0i8sRcjTBzPVaPo=; b=UFg2ufSIoyiFgdBjdAJ5aXO66/d6jUxWLgieM7BXiM8W4KMJnOHC76xP M30m6PSG6Y3ltQINMpXx5Q/tdOTVwKsqmi3qDeJ+8uMw8Qg0xaFsCkkHD ewxjCUuY8lJzoBM6hoINgvDSytacT3fOSdmNf5bQ6gFjZEO8uY0fAv/HY 7OMo9a5dFo6FGUY9wJCAtu8ADOt2WcW5llHJV9q4y4mfvEyRAQKCAFkwa RyS0GTlzi38IcoxVN2XVYSHn7/hlQlanxH7dJc46K+7QX42TB3qMuU0z1 lcT+vbQw21bbyAySwrozsnsVyVFeorsnOhZUuCh85gVBV69fP9wTxSYHC w==; X-IronPort-AV: E=McAfee;i="6500,9779,10598"; a="327313954" X-IronPort-AV: E=Sophos;i="5.97,239,1669104000"; d="scan'208";a="327313954" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Jan 2023 06:51:36 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10598"; a="654980482" X-IronPort-AV: E=Sophos;i="5.97,239,1669104000"; d="scan'208";a="654980482" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga007.jf.intel.com with ESMTP; 23 Jan 2023 06:51:35 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1pJyAX-00DmrJ-1z; Mon, 23 Jan 2023 16:51:33 +0200 Date: Mon, 23 Jan 2023 16:51:33 +0200 From: Andy Shevchenko To: Sakari Ailus Cc: linux-acpi@vger.kernel.org, linux-media@vger.kernel.org, rafael@kernel.org, heikki.krogerus@linux.intel.com Subject: Re: [PATCH v2 1/8] ACPI: property: Parse data node string references in properties Message-ID: References: <20230123134617.265382-1-sakari.ailus@linux.intel.com> <20230123134617.265382-2-sakari.ailus@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230123134617.265382-2-sakari.ailus@linux.intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org On Mon, Jan 23, 2023 at 03:46:10PM +0200, Sakari Ailus wrote: > Add support for parsing property references using strings, besides > reference objects that were previously supported. This allows also > referencing data nodes which was not possible with reference objects. > > Also add pr_fmt() macro to prefix printouts. > > While at it, update copyright. ... > - * Copyright (C) 2014, Intel Corporation > + * Copyright (C) 2014--2023, Intel Corporation Isn't one dash enough? $ git grep -n 'opyright.*[0-9]--[0-9]' | wc -l 37 $ git grep -n 'opyright.*[0-9]-[0-9]' | wc -l 15064 > * All rights reserved. > * > * Authors: Mika Westerberg > * Darren Hart > * Rafael J. Wysocki > + * Sakari Ailus Seems wrong indentation in comparison to the others. > */ ... > +static struct fwnode_handle * > +acpi_parse_string_ref(const struct fwnode_handle *fwnode, const char *refstring) > +{ > + acpi_handle scope, handle; > + struct acpi_data_node *dn; > + struct acpi_device *device; > + acpi_status status; > + > + if (is_acpi_device_node(fwnode)) { > + scope = to_acpi_device_node(fwnode)->handle; Interestingly that we have a helper for this -- ACPI_HANDLE_FWNODE()... > + } else if (is_acpi_data_node(fwnode)) { > + scope = to_acpi_data_node(fwnode)->handle; ...but not for this. > + } else { > + pr_err("bad node type for node %pfw\n", fwnode); > + return ERR_PTR(-EINVAL); > + } > + > + status = acpi_get_handle(scope, refstring, &handle); > + if (ACPI_FAILURE(status)) { > + acpi_handle_debug(scope, "can't get handle for %s", refstring); > + return ERR_PTR(-EINVAL); > + } > + > + device = acpi_fetch_acpi_dev(handle); > + if (device) > + return acpi_fwnode_handle(device); > + > + status = acpi_get_data_full(handle, acpi_nondev_subnode_tag, > + (void **)&dn, NULL); > + if (ACPI_FAILURE(status) || !dn) { > + acpi_handle_debug(handle, "can't find subnode"); > + return ERR_PTR(-EINVAL); > + } > + > + return &dn->fwnode; > +} -- With Best Regards, Andy Shevchenko