From patchwork Wed Oct 19 14:28:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heikki Krogerus X-Patchwork-Id: 5604 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp368286wrs; Wed, 19 Oct 2022 07:49:08 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6RfEsxUCDsy8lFhdOnjs1C2dprwCrcCSrmhgvYqj+aj8ffLKTJbOyY9zGPQtj2jBycNXe0 X-Received: by 2002:a17:906:58c7:b0:722:f4bf:cb75 with SMTP id e7-20020a17090658c700b00722f4bfcb75mr7066442ejs.450.1666190948598; Wed, 19 Oct 2022 07:49:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666190948; cv=none; d=google.com; s=arc-20160816; b=GJsWL1DvjgNCuAvZRrr7+ilmgWNBjRKr+oGF8fUucr6MDpNQx7GWdg7RfvAw1RGkX+ yx8pkRxusl/kiE3JxsoG4S+Y/nj+5BQI8Me7Tt4mqAYFijPvwh1M+XxEfFa9dZDLA2qO b8KdVPrtRZQ0rMiBZCRJ5tVA99DIti6g25ODCW+g+Lvi8BmN2whzpy10NyQ2RugkP6jP aYi1kKlcbLDjNE/S0h2MRkWDIKVtVL3ky2e6sn+5QpDARtXdZd6yYJx4cLbzvKufONkW 8ca+GYrg6BTU2uzB1br0FpnaOenfh2zGmKNqHP+ovduvdNH9RutNF8qFwiDF/vppbdUg SZOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=Fxm/2MTYVaQayPlAMV6soZDweemS2xXADrw5bXGdTEs=; b=AYLaPflQK3os2jmpBbGIjlIBtrEAxHI1dc8604K+IdZ44CZE3kafk9VCYNAv+WAT7N SEXdtBb63BWIpP2mEvlgUYVWsw9whJyTOmz9QsaUx+un2hE+IqLn8RWkNsDnLYx0qaKk UkmuMY/g7CmtVBvjD75bAl5KHFu1Qe2CW3nX+ZaqEF0IJbAzMCNIWfMI4nhGl0vMDSvj BwTmLInqXoZFumunb4+vHkFF416gdxGrEzu3o3HADxfPPZQwPYNpuX/VTiTbFUw/ChKp nhFm3t5fEnanPJM0jtZKHBGMKNEsNOR1uG/R2GKR9Xl5uv9wCcJBpwKHGb3Dyx6rmr7g F8fg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=fpO6aG8l; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l10-20020a1709060e0a00b007317ad1f9a4si11762775eji.310.2022.10.19.07.48.42; Wed, 19 Oct 2022 07:49:08 -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=fpO6aG8l; 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 S231313AbiJSOnS (ORCPT + 99 others); Wed, 19 Oct 2022 10:43:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50374 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230012AbiJSOm6 (ORCPT ); Wed, 19 Oct 2022 10:42:58 -0400 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08DFB6C117; Wed, 19 Oct 2022 07:28:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666189718; x=1697725718; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=oPd1b2RsFB8U0bOOTZPBrhSFDVyoHn3BOYgBQmWBVSY=; b=fpO6aG8lN/uHpowz8FSkAkr141oOoNXlQqYobyqkl9sqpQ1m8ZPvVska l65Xgxdbn1iLBfhQJWewyxoSvWh1YX0ox5RIBLPWI5TydCL9eb2VKAtrj WwY/B1FG53QhPkOGhcuISYaIFhpUsK6TO+3+YARMjhqjqK5eVw3Idj47p WJAbQKqGyRRnzn400AblO5xyPCIvg6MsnyihTBWYjz12oF8uISaOHik8v 0EPoUbtRq3dro9E4PxS4CQQ3XJEnMrhvAeGMnzY6iAn9ORvYDbLtryQwm Crck394TyPyOTCvGxY+v//lIV9FI4hs04p4d3WdCc2mmlWddhgikf8imi Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10505"; a="304040483" X-IronPort-AV: E=Sophos;i="5.95,196,1661842800"; d="scan'208";a="304040483" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Oct 2022 07:28:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10505"; a="771810982" X-IronPort-AV: E=Sophos;i="5.95,196,1661842800"; d="scan'208";a="771810982" Received: from black.fi.intel.com (HELO black.fi.intel.com.) ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 19 Oct 2022 07:28:32 -0700 From: Heikki Krogerus To: Mika Westerberg Cc: Andreas Noever , Michael Jamet , Yehezkel Bernat , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] thunderbolt: ACPI: Use the helper fwnode_find_reference() Date: Wed, 19 Oct 2022 17:28:54 +0300 Message-Id: <20221019142854.27364-1-heikki.krogerus@linux.intel.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747127840330550374?= X-GMAIL-MSGID: =?utf-8?q?1747127840330550374?= 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; - 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; }