Received: by 2002:a05:622a:251a:b0:39a:b4a2:e86 with SMTP id cm26csp560791qtb; Wed, 19 Oct 2022 08:57:33 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6+ah77+ZO77VCMIZpHObqor9bu2QjJEbKPxNGr05rAA2q1YClagIeDeSHlfEd0CM6M9qta X-Received: by 2002:a17:903:183:b0:184:8c1a:7a95 with SMTP id z3-20020a170903018300b001848c1a7a95mr9339705plg.137.1666195052916; Wed, 19 Oct 2022 08:57:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666195052; cv=none; d=google.com; s=arc-20160816; b=x71iOSXgJoEGyDl2MeKlBg/nqZ97HncrzijArpvPqTYaO1qCaxJWtWJqIm/JDKHwPG WBW1ke/4V5unp6HN3cGwOK/PJzfHfDCionUnSLM+SX53hF/KDYCggJFryy0H/ZjcbWOI yNQukg9MOGdr9T3c15a9pmS/zsrGKJ/C65+iZ4xW5tGohVhafcPQTzgsSCUv+jC95t4o ZVTkIWaOkf4lmoivzU9RO2zuGYmK9V0C4ftGUkiszz6UZjmc0eObz0YBhkV0D//4OdfI 8CdkXfzSR2qRSdLckSsPHajDQXjKYGES/Nn+DeO9RF3ISraLT8j8ipNjEDmF2OFubQAl PZRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=sqKOXxewMJJygQmBJh3ioHpixtGmz1k/LoAGJLqQhYQ=; b=BjcRehTyJdv9AqvQ0cwuw03b94GBsOsXA2OhSDErKO9cKzeEvF57F7SS1BsSnbiHc8 hGfxIsMeQOyjQwmP3EWRI2XmpIpTHJegKUhZqGYnkrbZQDvRJTdjIz+XsTierzo9syhu 1ZcWstT4dnugM+FVr1ClzoCLRU+FGHk4oBu4uhyQbc1fffXiX5g4M1TWq0ZpC2VbqsTR /D9ozVnB1Z5aClsKTg2inRwoCUp+P3sbi//YSruKTZmW5g9kQW+N2UUOIoqjPFBBPPY1 SEKMWnzPOVk+X9OxYWy1RpevA7Zdtwcf6TO1+JAuu1t/lIJiY1w80Q73W0c5eLYsTVs5 EzRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=BMRGLnU3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q16-20020a170902dad000b00177568a0e53si20835884plx.252.2022.10.19.08.57.20; Wed, 19 Oct 2022 08:57:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=BMRGLnU3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232036AbiJSPK1 (ORCPT + 99 others); Wed, 19 Oct 2022 11:10:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232667AbiJSPJe (ORCPT ); Wed, 19 Oct 2022 11:09:34 -0400 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D72041981; Wed, 19 Oct 2022 08:03:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666191784; x=1697727784; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=M5avbZVzN3hkB86Ed3UZwrL75aggqypPsv/GEymhqa0=; b=BMRGLnU3DFO3j9EEawe3vJecObozbMcIOlK2ZNLPGhmBrgHku4Kw8UdE rV4FH5oMVXkrTS4Q/RkuLFNoihUs20pqenvQ6ErB+FWM6j58qbHQr/ZiJ 1MQrLapNPtJIWNAgeYBvOfJeMGEoGg5tGq5WQgp17DrX7nTwjHBOxnotW 8pCvleKDigHqi9H+SvC7dxMvFSU56HJXLtNRhbDk7ZjFXrREa7zqIoKWN SOhPaHywuANWEaJSpjpiUTHKShKT/hUrIaEsG5aBtCxIrjHv9wjSpXNZ1 n8SoPmtx0E8lJ96jVGiHAMkfuax6eV0u+04YKuCal2L48jtlGKTsg8gB+ g==; X-IronPort-AV: E=McAfee;i="6500,9779,10505"; a="286826908" X-IronPort-AV: E=Sophos;i="5.95,196,1661842800"; d="scan'208";a="286826908" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Oct 2022 08:02:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10505"; a="771825861" X-IronPort-AV: E=Sophos;i="5.95,196,1661842800"; d="scan'208";a="771825861" Received: from kuha.fi.intel.com ([10.237.72.185]) by fmsmga001.fm.intel.com with SMTP; 19 Oct 2022 08:02:45 -0700 Received: by kuha.fi.intel.com (sSMTP sendmail emulation); Wed, 19 Oct 2022 18:02:44 +0300 Date: Wed, 19 Oct 2022 18:02:44 +0300 From: Heikki Krogerus To: Mika Westerberg Cc: Andreas Noever , Michael Jamet , Yehezkel Bernat , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] thunderbolt: ACPI: Use the helper fwnode_find_reference() Message-ID: References: <20221019142854.27364-1-heikki.krogerus@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221019142854.27364-1-heikki.krogerus@linux.intel.com> X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 19, 2022 at 05:28:54PM +0300, Heikki Krogerus wrote: > Replacing the direct fwnode_property_get_reference_args() > call will this wrapper function. > > No functional changes intended. > > Signed-off-by: Heikki Krogerus > --- > drivers/thunderbolt/acpi.c | 15 ++++----------- > 1 file changed, 4 insertions(+), 11 deletions(-) > > diff --git a/drivers/thunderbolt/acpi.c b/drivers/thunderbolt/acpi.c > index 7a8adf5ad5a09..48ac227e6d8a0 100644 > --- a/drivers/thunderbolt/acpi.c > +++ b/drivers/thunderbolt/acpi.c > @@ -15,24 +15,17 @@ static acpi_status tb_acpi_add_link(acpi_handle handle, u32 level, void *data, > void **return_value) > { > struct acpi_device *adev = acpi_fetch_acpi_dev(handle); > - struct fwnode_reference_args args; > struct fwnode_handle *fwnode; > struct tb_nhi *nhi = data; > struct pci_dev *pdev; > struct device *dev; > - int ret; > - > - if (!adev) > - return AE_OK; Oh, I'm sorry, I did not mean to remove that check. I'll resend. > - fwnode = acpi_fwnode_handle(adev); > - ret = fwnode_property_get_reference_args(fwnode, "usb4-host-interface", > - NULL, 0, 0, &args); > - if (ret) > + fwnode = fwnode_find_reference(acpi_fwnode_handle(adev), "usb4-host-interface", 0); > + if (IS_ERR(fwnode)) > return AE_OK; > > /* It needs to reference this NHI */ > - if (dev_fwnode(&nhi->pdev->dev) != args.fwnode) > + if (dev_fwnode(&nhi->pdev->dev) != fwnode) > goto out_put; > > /* > @@ -100,7 +93,7 @@ static acpi_status tb_acpi_add_link(acpi_handle handle, u32 level, void *data, > } > > out_put: > - fwnode_handle_put(args.fwnode); > + fwnode_handle_put(fwnode); > return AE_OK; > } > thanks, -- heikki