From patchwork Tue Dec 7 15:41:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 521881 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 90945C433EF for ; Tue, 7 Dec 2021 15:41:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238986AbhLGPpN (ORCPT ); Tue, 7 Dec 2021 10:45:13 -0500 Received: from mga18.intel.com ([134.134.136.126]:35537 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233215AbhLGPpM (ORCPT ); Tue, 7 Dec 2021 10:45:12 -0500 X-IronPort-AV: E=McAfee;i="6200,9189,10190"; a="224468584" X-IronPort-AV: E=Sophos;i="5.87,293,1631602800"; d="scan'208";a="224468584" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Dec 2021 07:41:42 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,293,1631602800"; d="scan'208";a="679485409" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga005.jf.intel.com with ESMTP; 07 Dec 2021 07:41:39 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id D168A15C; Tue, 7 Dec 2021 17:41:45 +0200 (EET) From: Andy Shevchenko To: Mika Westerberg , Rajmohan Mani , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Andreas Noever , Michael Jamet , Yehezkel Bernat , Andy Shevchenko Subject: [PATCH v1 1/1] thunderbolt: Do not dereference fwnode in struct device Date: Tue, 7 Dec 2021 17:41:43 +0200 Message-Id: <20211207154143.11477-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org In order to make the underneath API easier to change in the future, prevent users from dereferencing fwnode from struct device. Instead, use the specific dev_fwnode() API for that. Signed-off-by: Andy Shevchenko --- drivers/thunderbolt/acpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/thunderbolt/acpi.c b/drivers/thunderbolt/acpi.c index b67e72d5644b..861d0fafb1d9 100644 --- a/drivers/thunderbolt/acpi.c +++ b/drivers/thunderbolt/acpi.c @@ -31,7 +31,7 @@ static acpi_status tb_acpi_add_link(acpi_handle handle, u32 level, void *data, return AE_OK; /* It needs to reference this NHI */ - if (nhi->pdev->dev.fwnode != args.fwnode) + if (dev_fwnode(&nhi->pdev->dev) != args.fwnode) goto out_put; /*