Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp146050ima; Fri, 1 Feb 2019 00:50:48 -0800 (PST) X-Google-Smtp-Source: AHgI3IbspbhrLMQ82SCJ0eswCc7+weEaBSyXfUnEo22ukra9SIEj0ugz4RrdGaNq6vpLp2kJYt8j X-Received: by 2002:a63:4b60:: with SMTP id k32mr1393762pgl.186.1549011048627; Fri, 01 Feb 2019 00:50:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549011048; cv=none; d=google.com; s=arc-20160816; b=PWTzDrvNX3MCHTxp6BYTkeYLb7U7qC5NugEIc2N61RcVBobEK+sNHp8QhQo/QjuM34 hyY7mIbUsyyUx4YU5iWMf3wJkVjIsfv33dAd4dusiaa86cGbvp/gvf0BxNICDHehGFw3 zhz7ANTT2KuqLX8gCBv6Nqmph3JxMZ60rdBDoqbPPuxOhL132adeVjwrjKA6NbSLT+yh sJGE5T3QqUbedyKMwp4bO7QQqh0fLRneTHT49d85Sp+ETetR15ZvyMmfd+LJq+Nf8imI riNdQnb70quIbOR3N8sZCpkjxiNW+nqzkUaqj1gUJxKFN/GQQPZ6DTTPHItdunX9AS0q ReFg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=oeWjW7MYDj5Z0OrwE0athM1WZmC27Mlek0LN98l8BVY=; b=MbVgPzDyIl7LNQ29F4FllQGaNQipTrCscIrgUyzyLb/rbxsvHEzdnBQSH8BO8SdBCy nuRAL9/W9E2Ixh1sejMS91SFlPy98jmQpigyoAgN/N9Bgwy4uIOJi0a5X8SmIgGAeq6S K1L2XEDJT/3CqrZKjzx0+hhCcXWYjnr//IegXRwOLwPtMEUiMdHibp8WZEDP0iIM4vyg c7MrDQ25SiLDwBBOidpTiCGfbvxX3o04gV5XAt12prUauavv/MD75+WdZuVtyew6f1qQ P/nf6Rhk7b1+ggK5NaquHIbMb3hx5djH40iYU0JestdS3PsSLprHUT0Px4QZRVz9ty/F oZVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=dT07yaI+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d25si6496032pgd.88.2019.02.01.00.50.33; Fri, 01 Feb 2019 00:50:48 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=dT07yaI+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729333AbfBAIsN (ORCPT + 99 others); Fri, 1 Feb 2019 03:48:13 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:48286 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726172AbfBAIsL (ORCPT ); Fri, 1 Feb 2019 03:48:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From :Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=oeWjW7MYDj5Z0OrwE0athM1WZmC27Mlek0LN98l8BVY=; b=dT07yaI+2qOd4yysC+I6zQ0t/q e8R1Nemh+lcxBmHKoMTsTa3/OWuLAsKg38m87EolK9UaBBxa2W6AaIyQDxBcbDac0JHMYudwVb2nB 0lU8B+6QhrdWt82W8sZnvenvgD8qSyp16Kx9vENl6nj56xJIqhP4WAsJX+qKpYh3mOXwc1YTbQfXJ s3BTznpc98iSpCFLxLfzT4xs6157/3uNVkXh/CjNfjG4/ie25bdqNjmuZTA1qrQKtc32w8Bgnkeg1 I1UtOZuTUAbgdFXeihGQLQSslkZOER2SKbjXlBE55N/w0m46iF7MlwgXUy4gDesKIvu7S1LPfl3TG imhcKaXA==; Received: from 089144212163.atnat0021.highway.a1.net ([89.144.212.163] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1gpUUa-0001Ml-Bk; Fri, 01 Feb 2019 08:48:08 +0000 From: Christoph Hellwig To: John Crispin , Vinod Koul , Dmitry Tarnyagin , Nicolas Ferre , Sudip Mukherjee , Felipe Balbi , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org, netdev@vger.kernel.org, linux-usb@vger.kernel.org, linux-fbdev@vger.kernel.org, alsa-devel@alsa-project.org Cc: iommu@lists.linux-foundation.org Subject: [PATCH 02/18] dmaengine: imx-sdma: pass struct device to DMA API functions Date: Fri, 1 Feb 2019 09:47:45 +0100 Message-Id: <20190201084801.10983-3-hch@lst.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190201084801.10983-1-hch@lst.de> References: <20190201084801.10983-1-hch@lst.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The DMA API generally relies on a struct device to work properly, and only barely works without one for legacy reasons. Pass the easily available struct device from the platform_device to remedy this. Signed-off-by: Christoph Hellwig --- drivers/dma/imx-sdma.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index 86708fb9bda1..0b6bba0b9f38 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c @@ -677,7 +677,7 @@ static int sdma_load_script(struct sdma_engine *sdma, void *buf, int size, int ret; unsigned long flags; - buf_virt = dma_alloc_coherent(NULL, size, &buf_phys, GFP_KERNEL); + buf_virt = dma_alloc_coherent(sdma->dev, size, &buf_phys, GFP_KERNEL); if (!buf_virt) { return -ENOMEM; } @@ -696,7 +696,7 @@ static int sdma_load_script(struct sdma_engine *sdma, void *buf, int size, spin_unlock_irqrestore(&sdma->channel_0_lock, flags); - dma_free_coherent(NULL, size, buf_virt, buf_phys); + dma_free_coherent(sdma->dev, size, buf_virt, buf_phys); return ret; } @@ -1182,8 +1182,8 @@ static int sdma_request_channel0(struct sdma_engine *sdma) { int ret = -EBUSY; - sdma->bd0 = dma_alloc_coherent(NULL, PAGE_SIZE, &sdma->bd0_phys, - GFP_NOWAIT); + sdma->bd0 = dma_alloc_coherent(sdma->dev, PAGE_SIZE, &sdma->bd0_phys, + GFP_NOWAIT); if (!sdma->bd0) { ret = -ENOMEM; goto out; @@ -1842,7 +1842,7 @@ static int sdma_init(struct sdma_engine *sdma) /* Be sure SDMA has not started yet */ writel_relaxed(0, sdma->regs + SDMA_H_C0PTR); - sdma->channel_control = dma_alloc_coherent(NULL, + sdma->channel_control = dma_alloc_coherent(sdma->dev, MAX_DMA_CHANNELS * sizeof (struct sdma_channel_control) + sizeof(struct sdma_context_data), &ccb_phys, GFP_KERNEL); -- 2.20.1