public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Mika Westerberg <mika.westerberg@linux.intel.com>,
	Rajmohan Mani <rajmohan.mani@intel.com>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Andreas Noever <andreas.noever@gmail.com>,
	Michael Jamet <michael.jamet@intel.com>,
	Yehezkel Bernat <YehezkelShB@gmail.com>
Subject: Re: [PATCH v1 1/1] thunderbolt: Do not dereference fwnode in struct device
Date: Tue, 7 Dec 2021 17:49:29 +0200	[thread overview]
Message-ID: <Ya+CiaFial3Z+9n2@smile.fi.intel.com> (raw)
In-Reply-To: <20211207154143.11477-1-andriy.shevchenko@linux.intel.com>

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



  reply	other threads:[~2021-12-07 15:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-07 15:41 [PATCH v1 1/1] thunderbolt: Do not dereference fwnode in struct device Andy Shevchenko
2021-12-07 15:49 ` Andy Shevchenko [this message]
2021-12-08 10:26 ` Mika Westerberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Ya+CiaFial3Z+9n2@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=YehezkelShB@gmail.com \
    --cc=andreas.noever@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=michael.jamet@intel.com \
    --cc=mika.westerberg@linux.intel.com \
    --cc=rajmohan.mani@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox