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 D28CAC433F5 for ; Tue, 7 Dec 2021 15:50:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239126AbhLGPyE (ORCPT ); Tue, 7 Dec 2021 10:54:04 -0500 Received: from mga02.intel.com ([134.134.136.20]:63716 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239155AbhLGPyC (ORCPT ); Tue, 7 Dec 2021 10:54:02 -0500 X-IronPort-AV: E=McAfee;i="6200,9189,10190"; a="224861850" X-IronPort-AV: E=Sophos;i="5.87,293,1631602800"; d="scan'208";a="224861850" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Dec 2021 07:50:32 -0800 X-IronPort-AV: E=Sophos;i="5.87,293,1631602800"; d="scan'208";a="461308366" Received: from smile.fi.intel.com ([10.237.72.184]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Dec 2021 07:50:30 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.95) (envelope-from ) id 1mucig-003HF6-4A; Tue, 07 Dec 2021 17:49:30 +0200 Date: Tue, 7 Dec 2021 17:49:29 +0200 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 Subject: Re: [PATCH v1 1/1] thunderbolt: Do not dereference fwnode in struct device Message-ID: References: <20211207154143.11477-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211207154143.11477-1-andriy.shevchenko@linux.intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 07, 2021 at 05:41:43PM +0200, Andy Shevchenko wrote: > 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. ... > /* It needs to reference this NHI */ > - if (nhi->pdev->dev.fwnode != args.fwnode) > + if (dev_fwnode(&nhi->pdev->dev) != args.fwnode) Alternatively: if (!device_match_fwnode(&nhi->pdev->dev, args.fwnode)) Tell me. which one you prefer. > goto out_put; -- With Best Regards, Andy Shevchenko