From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Kishon <kishon@ti.com>, Tony Lindgren <tony@atomide.com>,
Roger Quadros <rogerq@ti.com>,
linux-mmc <linux-mmc@vger.kernel.org>,
linux-omap <linux-omap@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mmc: omap: Use dma_request_chan() for requesting DMA channel
Date: Wed, 4 May 2016 06:59:54 +0300 [thread overview]
Message-ID: <8797d828-eb71-c747-f63a-e77762c51d82@ti.com> (raw)
In-Reply-To: <a7e34ffa-19d4-48fb-8d13-a151fbafd842@ti.com>
On 05/03/2016 11:00 PM, Peter Ujfalusi wrote:
>>> @@ -1382,29 +1379,31 @@ static int mmc_omap_probe(struct platform_device *pdev)
>>> goto err_free_iclk;
>>> }
>>>
>>> - dma_cap_zero(mask);
>>> - dma_cap_set(DMA_SLAVE, mask);
>>> -
>>> host->dma_tx_burst = -1;
>>> host->dma_rx_burst = -1;
>>>
>>> - res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "tx");
>>> - if (res)
>>> - sig = res->start;
>>> - host->dma_tx = dma_request_slave_channel_compat(mask,
>>> - omap_dma_filter_fn, &sig, &pdev->dev, "tx");
>>> - if (!host->dma_tx)
>>> - dev_warn(host->dev, "unable to obtain TX DMA engine channel %u\n",
>>> - sig);
>>> -
>>> - res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "rx");
>>> - if (res)
>>> - sig = res->start;
>>> - host->dma_rx = dma_request_slave_channel_compat(mask,
>>> - omap_dma_filter_fn, &sig, &pdev->dev, "rx");
>>> - if (!host->dma_rx)
>>> - dev_warn(host->dev, "unable to obtain RX DMA engine channel %u\n",
>>> - sig);
>>> + host->dma_tx = dma_request_chan(&pdev->dev, "tx");
>>> + if (IS_ERR(host->dma_tx)) {
>>> + ret = PTR_ERR(host->dma_tx);
>>> + if (ret == -EPROBE_DEFER)
>>> + goto err_free_iclk;
>
> and one clk_put(host->fclk) is missing from here.
>
>>> +
>>> + host->dma_tx = NULL;
>>
>> Instead of setting this to NULL, let's keep its value and later check
>> it with IS_ERR() when needed.
>
> I thought about it, but decided against without need to have changes in other
> places in the driver.
This sentence does not make too much sense ;) Let's try it again:
So, I have considered to use PTR_ERR in the driver for the DMA channel, but I
wanted to avoid too broad changes in the driver. Keeping the ERR_PTR would
bring no runtime benefit since we only care if we have channel or not.
--
Péter
next prev parent reply other threads:[~2016-05-04 4:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-29 13:06 Peter Ujfalusi
2016-05-03 8:46 ` Ulf Hansson
2016-05-03 20:00 ` Peter Ujfalusi
2016-05-04 3:59 ` Peter Ujfalusi [this message]
2016-05-04 7:32 ` Ulf Hansson
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=8797d828-eb71-c747-f63a-e77762c51d82@ti.com \
--to=peter.ujfalusi@ti.com \
--cc=kishon@ti.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=rogerq@ti.com \
--cc=tony@atomide.com \
--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
all inboxes | Powered by JetHome®