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 7229AECAAD5 for ; Mon, 29 Aug 2022 17:00:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230256AbiH2RAM (ORCPT ); Mon, 29 Aug 2022 13:00:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58940 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231209AbiH2RAJ (ORCPT ); Mon, 29 Aug 2022 13:00:09 -0400 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F3AF34A811; Mon, 29 Aug 2022 10:00:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1661792407; x=1693328407; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=6nppHl6aPXqc0co9Epu68ExNtuFi/fpCELicTEOpI80=; b=Qjw3/7BFfbUa9vcgckOXu9Opxf/g/G5pfRyCOf49MTRw1zBbjffsuEjE Qx0C0jFPt2U/W5YCOWqLleRF09DtDymEztDQdn4sZUMcDuGI6ywtnKZ1v NXUV/8yFggHf+SV4e2rv5H4JDd8PA4qLstAfPcZA3pNYnpfauS5xdP8Es pilXT02Xkw8bIedF/AffvpXkp39K3ildMOmEB6F5DGtSWfHpkoOWgqLlp P5hEDPOsDyQi08Dizo1/ACmAe1LfesqMFsiaEvXgi3Ae3vkx/WacqQgc+ wOaeoQbod8bXJj9AYGnLJ+hd5NldSckUYCVeVNQhAbbU1s9qNTKbrHQLP g==; X-IronPort-AV: E=McAfee;i="6500,9779,10454"; a="295724910" X-IronPort-AV: E=Sophos;i="5.93,272,1654585200"; d="scan'208";a="295724910" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Aug 2022 10:00:05 -0700 X-IronPort-AV: E=Sophos;i="5.93,272,1654585200"; d="scan'208";a="562295517" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Aug 2022 10:00:04 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1oSi7F-005c6k-2I; Mon, 29 Aug 2022 20:00:01 +0300 Date: Mon, 29 Aug 2022 20:00:01 +0300 From: Andy Shevchenko To: "Rafael J. Wysocki" Cc: Linux ACPI , LKML , Linux PM Subject: Re: [PATCH v1] ACPI: property: Use acpi_dev_parent() Message-ID: References: <4756666.GXAFRqVoOG@kreacher> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4756666.GXAFRqVoOG@kreacher> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org On Mon, Aug 29, 2022 at 06:12:33PM +0200, Rafael J. Wysocki wrote: > From: Rafael J. Wysocki > > After introducing acpi_dev_parent() in commit 62fcb99bdf10 ("ACPI: Drop > parent field from struct acpi_device"), it is better to use it instead > of accessing the dev.parent field in struct acpi_device directly. > > Modify acpi_node_get_parent() accordingly. Reviewed-by: Andy Shevchenko Thanks! > Suggested-by: Andy Shevchenko > Signed-off-by: Rafael J. Wysocki > --- > drivers/acpi/property.c | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > Index: linux-pm/drivers/acpi/property.c > =================================================================== > --- linux-pm.orig/drivers/acpi/property.c > +++ linux-pm/drivers/acpi/property.c > @@ -1269,10 +1269,11 @@ acpi_node_get_parent(const struct fwnode > return to_acpi_data_node(fwnode)->parent; > } > if (is_acpi_device_node(fwnode)) { > - struct device *dev = to_acpi_device_node(fwnode)->dev.parent; > + struct acpi_device *parent; > > - if (dev) > - return acpi_fwnode_handle(to_acpi_device(dev)); > + parent = acpi_dev_parent(to_acpi_device_node(fwnode)); > + if (parent) > + return acpi_fwnode_handle(parent); > } > > return NULL; > > > -- With Best Regards, Andy Shevchenko