Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp148251ima; Fri, 1 Feb 2019 00:53:49 -0800 (PST) X-Google-Smtp-Source: ALg8bN4+Sy0MMWnz8S8xcA+/VpUerCEIrdKqZUeDXxICQ4N9eAnRFZ/qO3pNDIXq+PBqeUF9DamW X-Received: by 2002:a17:902:7c85:: with SMTP id y5mr38261439pll.63.1549011229875; Fri, 01 Feb 2019 00:53:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549011229; cv=none; d=google.com; s=arc-20160816; b=KajxQKN3L9P0hFzTDNR3AjBElDapsBhkNqdmIpfRNLXRWVB8vyVWrVLbWU+72ocDkd TIxz3KRvWTzckZGvjmKz8/hBHPzTP6UezSvR/6Uv5+zJGnz4l6uMfGiepZsOsYtQCxe7 121JxRgyTe2DwZYRCka4GzjPrvjpkEf4+jhIPdhRJ3IkwMI4mBO33zA5fA3tj2JUFbJB an2RaF90BTIhs5O/sMWwzi4jwTvjQfatjsjmiuaoA3DFo4X949iaJUwh8HqVxOGiYD3W TG12Ud+ARLQQIMDaTnXAKbIZrzf0RdB51nEV5NQT1bcabc04+87jacF7wLi+FcKKJBqK QAJA== 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=l3DOgCmu34NqZKnulcp3vGWxIiN/v8w0KyW6Do+gkok=; b=KHCPXJN5f8VwUl3Lo8wMu1jkcUjQ4Z+bzh5xmULQVnD8hvVVFFWZiwzs8RQhMuikHA /+hL+4RYY215/OyPjqf9Vep9coTklYrrkatOuxY7mSKXm3lc6GVi+EoXW+Xw1SYM/38R p3HnY2B760xRKI2qg5BmzL7VCkITeTQlgbBsJgbkUf9lF3FS2NKHjwqljrXwmTJUTLbt P2BheDGSLaW3CFSaLf0Cjyngl9oBu0NjNoka5g9sygzt7q8YTzYsQcRuoFE+eKGptX4K r5tGKrw6xsRVHCbFRlY6fZpVRLzdnOZYpfgAwCSN2PJ+ZGLNwBviunvGsRLA3z7ClmdP /D8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=FtSVRlxt; 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 e68si7009171pfb.101.2019.02.01.00.53.34; Fri, 01 Feb 2019 00:53:49 -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=FtSVRlxt; 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 S1728465AbfBAIvO (ORCPT + 99 others); Fri, 1 Feb 2019 03:51:14 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:48266 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729225AbfBAIsI (ORCPT ); Fri, 1 Feb 2019 03:48:08 -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=l3DOgCmu34NqZKnulcp3vGWxIiN/v8w0KyW6Do+gkok=; b=FtSVRlxtfJotCCF5iySwft2MRE EmQtssDlmFitwgtxHgjDJuhNlKlu1/n86S5ZrJJIF3Zqo7THN83AHxEdL9Hy2IoIrn8GGYUio7mQv ZrGv1lT+lUpm91/4cPzbJ4FFJozlzjPW3Z9zNt3qSV9GkCmu6E8ze4FpEAJfikfG7DA2elWRNXyc3 UIXvaZcevaWhL3dNM8I0NO5WAPU75X+ihtow5zV97kbXy0Dg7XIU57FfwFToqZwKTPKl02PqLUoAH WWMc8EOvcbo+7O280I2w+zzYRKHoYCPZmUWKYXDBBhNyqJAr4GX2sOQ0Ay71zssw74oijWlRijI9G AzYUo5Bw==; 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 1gpUUX-0001Mb-R2; Fri, 01 Feb 2019 08:48:06 +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 01/18] MIPS: lantiq: pass struct device to DMA API functions Date: Fri, 1 Feb 2019 09:47:44 +0100 Message-Id: <20190201084801.10983-2-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. Also use GFP_KERNEL instead of GFP_ATOMIC as the gfp_t for the memory allocation, as we aren't in interrupt context or under a lock. Note that this whole function looks somewhat bogus given that we never even look at the returned dma address, and the CPHYSADDR magic on a returned noncached mapping looks "interesting". But I'll leave that to people more familiar with the code to sort out. Signed-off-by: Christoph Hellwig --- arch/mips/lantiq/xway/vmmc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/mips/lantiq/xway/vmmc.c b/arch/mips/lantiq/xway/vmmc.c index 577ec81b557d..3deab9a77718 100644 --- a/arch/mips/lantiq/xway/vmmc.c +++ b/arch/mips/lantiq/xway/vmmc.c @@ -31,8 +31,8 @@ static int vmmc_probe(struct platform_device *pdev) dma_addr_t dma; cp1_base = - (void *) CPHYSADDR(dma_alloc_coherent(NULL, CP1_SIZE, - &dma, GFP_ATOMIC)); + (void *) CPHYSADDR(dma_alloc_coherent(&pdev->dev, CP1_SIZE, + &dma, GFP_KERNEL)); gpio_count = of_gpio_count(pdev->dev.of_node); while (gpio_count > 0) { -- 2.20.1