public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Sylwester Nawrocki <s.nawrocki@samsung.com>
Cc: ulf.hansson@linaro.org, linux-samsung-soc@vger.kernel.org,
	sam.van.den.berge@telenet.be, linux-mmc@vger.kernel.org
Subject: Re: [PATCH] mmc: s3cmci: Use DMA slave map rather than exported DMA filter
Date: Wed, 26 Oct 2016 15:31:08 +0200	[thread overview]
Message-ID: <5765449.Er1VJf0Pit@wuerfel> (raw)
In-Reply-To: <11c41f92-5591-dd45-816f-6740da76b91f@samsung.com>

On Wednesday, October 26, 2016 2:49:44 PM CEST Sylwester Nawrocki wrote:
> On 10/26/2016 11:21 AM, Arnd Bergmann wrote:
> > On Wednesday, October 26, 2016 11:08:27 AM CEST Sylwester Nawrocki wrote:
> >> > @@ -1685,13 +1684,7 @@ static int s3cmci_probe(struct platform_device *pdev)
> >> >         /* depending on the dma state, get a dma channel to use. */
> >> >  
> >> >         if (s3cmci_host_usedma(host)) {
> >> > -               dma_cap_mask_t mask;
> >> > -
> >> > -               dma_cap_zero(mask);
> >> > -               dma_cap_set(DMA_SLAVE, mask);
> >> > -
> >> > -               host->dma = dma_request_slave_channel_compat(mask,
> >> > -                       s3c24xx_dma_filter, (void *)DMACH_SDI, &pdev->dev, "rx-tx");
> >> > +               host->dma = dma_request_slave_channel(&pdev->dev, "rx-tx");
> >> >                 if (!host->dma) {
> >> >                         dev_err(&pdev->dev, "cannot get DMA channel.\n");
> >> >                         ret = -EBUSY;
> >
> > Can you convert it to use dma_request_chan()+PTR_ERR_OR_ZERO() instead?
> 
> Thanks for your review. dma_request_chan() seems to be returning 
> either valid pointer or ERR_PTR(), so it would be sufficient 
> to use just PTR_ERR(host->dma) on error path?

Correct. You can use either

	if (IS_ERR(host->dma) {
		ret = PTR_ERR(host->dma);
		goto probe_free_gpio_wp;
	}

or

	ret = PTR_ERR_OR_ZERO(host->dma);
	if (ret)
		goto probe_free_gpio_wp;

The two do exactly the same, I just find the second one slightly more
intuitive, and I've seen a couple of spurious warnings caused by
the first (that won't happen here).

	Arnd

      reply	other threads:[~2016-10-26 13:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-26  9:08 [PATCH] mmc: s3cmci: Use DMA slave map rather than exported DMA filter Sylwester Nawrocki
2016-10-26  9:21 ` Arnd Bergmann
2016-10-26 12:49   ` Sylwester Nawrocki
2016-10-26 13:31     ` Arnd Bergmann [this message]

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=5765449.Er1VJf0Pit@wuerfel \
    --to=arnd@arndb.de \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=s.nawrocki@samsung.com \
    --cc=sam.van.den.berge@telenet.be \
    --cc=ulf.hansson@linaro.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