Re: [PATCH v2 2/3] dmaengine: Use device_match_of_node() helper
From: Andy Shevchenko
Date: Mon Nov 10 2025 - 05:45:29 EST
On Mon, Nov 10, 2025 at 11:20:33AM +0100, Praveen Kumar wrote:
> On Mon, Nov 10, 2025 at 09:47:44AM +0100, Andy Shevchenko wrote:
> > Instead of open coding, use device_match_of_node() helper.
...
> > - if (np && device->dev->of_node && np != device->dev->of_node)
> > + if (np && !device_match_of_node(device->dev, np))
>
> I see a difference in what device_match_of_node does vs what was
> happening in the previous check. And, we have an unwanted double
> check of np.
Nope.
> int device_match_of_node(struct device *dev, const void *np)
> {
> return np && dev->of_node == np;
> }
>
> Instead, I would recommend,
>
> if (device->dev->of_node && !device_match_of_node(device->dev, np))
> continue;
This will be the wrong check. Think about it, yeah, it's not so trivial check
and hence the change.
--
With Best Regards,
Andy Shevchenko