lkml.org 
[lkml]   [2021]   [Dec]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v1 1/1] thunderbolt: Do not dereference fwnode in struct device
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


\
 
 \ /
  Last update: 2021-12-07 16:50    [W:0.167 / U:0.280 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site