From patchwork Tue Dec 17 10:39:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Ujfalusi X-Patchwork-Id: 181851 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp5556566ile; Tue, 17 Dec 2019 02:39:13 -0800 (PST) X-Google-Smtp-Source: APXvYqyajNlvqqbWem/f3vDNYwNsvkHVTiQq5YyxI34veNd9eKalzNg6EMRAU4UZwZENVcPBS8AK X-Received: by 2002:a05:6830:1bda:: with SMTP id v26mr7624858ota.314.1576579152967; Tue, 17 Dec 2019 02:39:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576579152; cv=none; d=google.com; s=arc-20160816; b=F15X8JU++b7jfT8pnxWIi49PipdtK+jgkCniqp1y5QdNcXBg/DbchFORp8aKyLXKSi F8GHvNHoaJ97rsV3ehrRDzIJbcbsM4v0evbYo/1B0n2Nm1yFHcFivEzCtkgFFkmBJz8N 6GD9SUR1ljpt7OLhCZ5l3oejxS9COAcTsRawSdF/wG+FX3EXxLACFjDu1e0hWR23qw9O h5+Zenbncn9/RjcUnbab1DAatFXFBUlwRTHzyT4E/tl2tVDQmqAd2gtE8k4WQ2iEBIyo EIsGRCOjjYgZYheMHMGd7g2zErpue7NosaoixfqKuwxkLr9+Pm9Y5XAzVhHhUYQhlM/x AnZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=L+n8eG++qBCc548Y3EO87ASj7TEZ4gDHxdGRNi6ufvI=; b=CsLK+ElCImcIV/04as+qUo78lQ2Xz0QSsm/3ZeiJB0DW7Jy1jbTjx5RkYkzJ1RIuOP Cuf60UbEgSs4U8HCSOf7kz0t9QZrHg3bs0Ej6zHlbBdKcYxt34ZdbGo41YFusOva4yX8 XPzcTpcn9pkvEW6sue8yXtNr9uK4TjVoArnd10MAwcl7edysZ0DgdKKE+41uaXN9YWLA /OFyjDGegLl8WWXhRqwM5WHy/XMVf5hMqyg7rn8Z4b3YpYqdxzpweaMgVTckvyWaqxq7 Nqt3o0LHod4weyzHpfYA3DQRMn57RBLFH+sAmUkAdCnE2zSVeRRTW71Av0JvBpaMfv/b P/ag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=nFDJ70bL; spf=pass (google.com: best guess record for domain of linux-media-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-media-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j13si11940492otk.9.2019.12.17.02.39.12; Tue, 17 Dec 2019 02:39:12 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-media-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=nFDJ70bL; spf=pass (google.com: best guess record for domain of linux-media-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-media-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726496AbfLQKjM (ORCPT + 4 others); Tue, 17 Dec 2019 05:39:12 -0500 Received: from lelv0142.ext.ti.com ([198.47.23.249]:48926 "EHLO lelv0142.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725870AbfLQKjM (ORCPT ); Tue, 17 Dec 2019 05:39:12 -0500 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id xBHAdA4Z078554; Tue, 17 Dec 2019 04:39:10 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1576579150; bh=L+n8eG++qBCc548Y3EO87ASj7TEZ4gDHxdGRNi6ufvI=; h=From:To:CC:Subject:Date; b=nFDJ70bLHp4TP5ekquuuilLfCXXBYFAsx0jNrnAWr/FNxNfi5iH+jZ7941j0EZLtn 6jiJx5VEIENB5o0jGVSD3DLNPz7a2TAZLiVDMrb11so4BmHrDxjP/q3McUgM/jUQzR Trlq7PfXXVbXpW58zaAQci+spShFAx5zxViLafqI= Received: from DFLE105.ent.ti.com (dfle105.ent.ti.com [10.64.6.26]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id xBHAdAwb128013 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 17 Dec 2019 04:39:10 -0600 Received: from DFLE100.ent.ti.com (10.64.6.21) by DFLE105.ent.ti.com (10.64.6.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3; Tue, 17 Dec 2019 04:39:09 -0600 Received: from fllv0040.itg.ti.com (10.64.41.20) by DFLE100.ent.ti.com (10.64.6.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3 via Frontend Transport; Tue, 17 Dec 2019 04:39:09 -0600 Received: from feketebors.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id xBHAd7Uv024500; Tue, 17 Dec 2019 04:39:08 -0600 From: Peter Ujfalusi To: CC: , , , Subject: [PATCH] media: pxa_camera: Use dma_request_chan() instead dma_request_slave_channel() Date: Tue, 17 Dec 2019 12:39:23 +0200 Message-ID: <20191217103923.23066-1-peter.ujfalusi@ti.com> X-Mailer: git-send-email 2.24.0 MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org dma_request_slave_channel() is a wrapper on top of dma_request_chan() eating up the error code. By using dma_request_chan() directly the driver can support deferred probing against DMA. Signed-off-by: Peter Ujfalusi --- drivers/media/platform/pxa_camera.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) -- Peter Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki diff --git a/drivers/media/platform/pxa_camera.c b/drivers/media/platform/pxa_camera.c index 43ae645d866b..321dee9ca81c 100644 --- a/drivers/media/platform/pxa_camera.c +++ b/drivers/media/platform/pxa_camera.c @@ -2440,23 +2440,23 @@ static int pxa_camera_probe(struct platform_device *pdev) pcdev->base = base; /* request dma */ - pcdev->dma_chans[0] = dma_request_slave_channel(&pdev->dev, "CI_Y"); - if (!pcdev->dma_chans[0]) { + pcdev->dma_chans[0] = dma_request_chan(&pdev->dev, "CI_Y"); + if (IS_ERR(pcdev->dma_chans[0])) { dev_err(&pdev->dev, "Can't request DMA for Y\n"); - return -ENODEV; + return PTR_ERR(pcdev->dma_chans[0]); } - pcdev->dma_chans[1] = dma_request_slave_channel(&pdev->dev, "CI_U"); - if (!pcdev->dma_chans[1]) { - dev_err(&pdev->dev, "Can't request DMA for Y\n"); - err = -ENODEV; + pcdev->dma_chans[1] = dma_request_chan(&pdev->dev, "CI_U"); + if (IS_ERR(pcdev->dma_chans[1])) { + dev_err(&pdev->dev, "Can't request DMA for U\n"); + err = PTR_ERR(pcdev->dma_chans[1]); goto exit_free_dma_y; } - pcdev->dma_chans[2] = dma_request_slave_channel(&pdev->dev, "CI_V"); - if (!pcdev->dma_chans[2]) { + pcdev->dma_chans[2] = dma_request_chan(&pdev->dev, "CI_V"); + if (IS_ERR(pcdev->dma_chans[2])) { dev_err(&pdev->dev, "Can't request DMA for V\n"); - err = -ENODEV; + err = PTR_ERR(pcdev->dma_chans[2]); goto exit_free_dma_u; }