[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <a86506727555e6cd38681b94fcecf6b7fabf5bc8.camel@gmail.com>
Date: Tue, 04 Jan 2022 00:59:38 +0900
From: Akihiro TSUKADA <tskd08@...il.com>
To: Christophe JAILLET <christophe.jaillet@...adoo.fr>,
mchehab@...nel.org, andy.shevchenko@...il.com,
kirill.shilimanov@...wei.com, novikov@...ras.ru
Cc: linux-media@...r.kernel.org, linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] media: pt3: Use dma_set_mask_and_coherent() and
simplify code
> Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
> ---
> drivers/media/pci/pt3/pt3.c | 16 ++++------------
> 1 file changed, 4 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/media/pci/pt3/pt3.c
> b/drivers/media/pci/pt3/pt3.c
> index 0d51bdf01f43..11f26cac0abc 100644
> --- a/drivers/media/pci/pt3/pt3.c
> +++ b/drivers/media/pci/pt3/pt3.c
> @@ -707,18 +707,10 @@ static int pt3_probe(struct pci_dev *pdev,
> const struct pci_device_id *ent)
> if (ret < 0)
> return ret;
>
> - ret = dma_set_mask(&pdev->dev, DMA_BIT_MASK(64));
> - if (ret == 0)
> - dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(64));
> - else {
> - ret = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32));
> - if (ret == 0)
> - dma_set_coherent_mask(&pdev->dev,
> DMA_BIT_MASK(32));
> - else {
> - dev_err(&pdev->dev, "Failed to set DMA
> mask\n");
> - return ret;
> - }
> - dev_info(&pdev->dev, "Use 32bit DMA\n");
> + ret = dma_set_mask_and_coherent(&pdev->dev,
> DMA_BIT_MASK(64));
> + if (ret) {
> + dev_err(&pdev->dev, "Failed to set DMA mask\n");
> + return ret;
> }
>
> pt3 = devm_kzalloc(&pdev->dev, sizeof(*pt3), GFP_KERNEL);
tested on x86_64.
Acked-by: Akihiro Tsukada <tskd08@...il.com>
Powered by blists - more mailing lists