From: Praveen Kumar <kpraveen.lkml@gmail.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org,
Vinod Koul <vkoul@kernel.org>
Subject: Re: [PATCH v2 2/3] dmaengine: Use device_match_of_node() helper
Date: Mon, 10 Nov 2025 11:20:33 +0100 [thread overview]
Message-ID: <aRG8cVly3b7sR9Vw@u67f9ca6e60d851.ant.amazon.com> (raw)
In-Reply-To: <20251110085349.3414507-3-andriy.shevchenko@linux.intel.com>
On Mon, Nov 10, 2025 at 09:47:44AM +0100, Andy Shevchenko wrote:
> Instead of open coding, use device_match_of_node() helper.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
> drivers/dma/dmaengine.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c
> index eb27a72cd4c5..e89280587d5d 100644
> --- a/drivers/dma/dmaengine.c
> +++ b/drivers/dma/dmaengine.c
> @@ -765,7 +765,7 @@ struct dma_chan *__dma_request_channel(const dma_cap_mask_t *mask,
> mutex_lock(&dma_list_mutex);
> list_for_each_entry_safe(device, _d, &dma_device_list, global_node) {
> /* Finds a DMA controller with matching device node */
> - 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.
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;
Regards,
Praveen Kumar.
> continue;
>
> chan = find_candidate(device, mask, fn, fn_param);
> --
> 2.50.1
>
next prev parent reply other threads:[~2025-11-10 10:20 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-10 8:47 [PATCH v2 0/3] dmaengine: A little cleanup and refactoring Andy Shevchenko
2025-11-10 8:47 ` [PATCH v2 1/3] dmaengine: Refactor devm_dma_request_chan() for readability Andy Shevchenko
2025-11-10 8:47 ` [PATCH v2 2/3] dmaengine: Use device_match_of_node() helper Andy Shevchenko
2025-11-10 10:20 ` Praveen Kumar [this message]
2025-11-10 10:43 ` Andy Shevchenko
2025-11-10 8:47 ` [PATCH v2 3/3] dmaengine: Sort headers alphabetically Andy Shevchenko
2026-01-08 6:43 ` [PATCH v2 0/3] dmaengine: A little cleanup and refactoring Andy Shevchenko
2026-01-09 2:33 ` Vinod Koul
2026-01-09 17:37 ` Andy Shevchenko
2026-02-25 11:23 ` Vinod Koul
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=aRG8cVly3b7sR9Vw@u67f9ca6e60d851.ant.amazon.com \
--to=kpraveen.lkml@gmail.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=dmaengine@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=vkoul@kernel.org \
/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
all inboxes | Powered by JetHome®