All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: "Bence Csókás" <csokas.bence@prolan.hu>
Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org,
	Vinod Koul <vkoul@kernel.org>
Subject: Re: [PATCH v7 1/2] dma: Add devm_dma_request_chan()
Date: Tue, 26 Aug 2025 11:21:00 +0300	[thread overview]
Message-ID: <aK1ubIiYCOwIFM5r@pixelbook> (raw)
In-Reply-To: <20250610082256.400492-2-csokas.bence@prolan.hu>

Tue, Jun 10, 2025 at 10:22:53AM +0200, Bence Csókás kirjoitti:
> Expand the arsenal of devm functions for DMA devices, this time for
> requesting channels.

...

> +/**
> + * devm_dma_request_chan - try to allocate an exclusive slave channel
> + * @dev:	pointer to client device structure
> + * @name:	slave channel name
> + *
> + * Returns pointer to appropriate DMA channel on success or an error pointer.
> + *
> + * The operation is managed and will be undone on driver detach.

This introduced a kernel-doc validation issue (Missing Return section).

> + */

> +

Unneeded blank line.

> +struct dma_chan *devm_dma_request_chan(struct device *dev, const char *name)

> +	struct dma_chan *chan = dma_request_chan(dev, name);
> +	int ret = 0;
> +
> +	if (!IS_ERR(chan))
> +		ret = devm_add_action_or_reset(dev, dmaenginem_release_channel, chan);
> +
> +	if (ret)
> +		return ERR_PTR(ret);
> +
> +	return chan;

Hmm... We usually use "error check" pattern
Compare to


	struct dma_chan *chan;
	int ret;

	chan = dma_request_chan(dev, name);
	if (IS_ERR(chan))
		return chan;

	ret = devm_add_action_or_reset(dev, dmaenginem_release_channel, chan);
	if (ret)
		return ERR_PTR(ret);

	return chan;

> +}

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2025-08-26  8:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-10  8:22 [PATCH v7 0/2] Add `devm_dma_request_chan()` to simplify probe path in atmel-quadspi.c Bence Csókás
2025-06-10  8:22 ` [PATCH v7 1/2] dma: Add devm_dma_request_chan() Bence Csókás
2025-08-26  8:21   ` Andy Shevchenko [this message]
2025-06-10  8:22 ` [PATCH v7 2/2] spi: atmel-quadspi: Use `devm_dma_request_chan()` Bence Csókás
2025-06-10 11:49 ` [PATCH v7 0/2] Add `devm_dma_request_chan()` to simplify probe path in atmel-quadspi.c Mark Brown
2025-06-26 22:20   ` Vinod Koul
2025-06-26 22:14 ` (subset) " Vinod Koul
2025-06-26 22:48 ` Vinod Koul
2025-06-27 12:51 ` Mark Brown

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=aK1ubIiYCOwIFM5r@pixelbook \
    --to=andy.shevchenko@gmail.com \
    --cc=csokas.bence@prolan.hu \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.