Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp146080ima; Fri, 1 Feb 2019 00:50:50 -0800 (PST) X-Google-Smtp-Source: AHgI3IZmxqXCzEJOXblYfb5blrzT34K24Aapt300enlMIhrmI3JUDXN/6zDdP7quH9tw4h9Hiaq3 X-Received: by 2002:a62:e012:: with SMTP id f18mr5690338pfh.119.1549011050002; Fri, 01 Feb 2019 00:50:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549011049; cv=none; d=google.com; s=arc-20160816; b=FFWLSmVOGEowJ1mB/RvwYtH1OK6zgBb8SKSuhIOUWC4qQmiNiv2Cu/tq45qGl1Ijw/ SKM6HetFi9eoPiEcCnPM4norWRQ8rpj6LvwUA/C6KQmeOKh6ygZ7dPwYfYA6P9++wDFZ 3Z07qZLApOm+r4W3x+8h/GgHmWrUBEwiPb0J6gSY7Dzt9Lsis8f+xqWdMjZBC97zqgAm 73Ilxvk/gJpuIU81+Mp8JdnyT9fyn/vYa2TEGYxSaCSzz8FlkW/Q5N11aGoaT2greV2P cVctGCbDM3eRPBBK7pIkxeJlvurqkVbbIAcLUixjBiuaFXfAFlBtAVPyrdo/4uLkJkHx npUw== 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=CxZHu4dBypMzIJdePoRBvzcE17U6xI+P3h/hNk9DnbQ=; b=z6EId8T9nPDX8+VSG+MGqzbFhyUV+pfu+nw7fyn8pnw+TaN8DVLF4jkwHYuqr4HOVG NjmPtBsx/Bo/K1EZ0GULcHGZXNzAU5KMFOXcsYk1mE5mvGXeZxij5breRj4SyeSVPo7p xJ2oGK4+v1PKnoUiFbarkoFSKpbY0K8VmtF4fjgE0AsAjJ2cv7w4x4dE8Ow+oN0pebt7 Fx/Gl9Zu0Ii4366EqM+yP70igi5uAAJ4cs0R3yB68dDwqUTejQ63Rk7G9rlGxHHO247u UaC2s/d3H2/vV5Z6vtEBITWU9/0lwnp3LhDPRynuHMGOWqlnp5qYYjEq6KrsczIWsKOx cwkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=l6xSAXci; 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 c65si7080551pfa.148.2019.02.01.00.50.34; Fri, 01 Feb 2019 00:50: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=l6xSAXci; 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 S1729398AbfBAIsR (ORCPT + 99 others); Fri, 1 Feb 2019 03:48:17 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:48326 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726172AbfBAIsQ (ORCPT ); Fri, 1 Feb 2019 03:48:16 -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=CxZHu4dBypMzIJdePoRBvzcE17U6xI+P3h/hNk9DnbQ=; b=l6xSAXciTrUv6yu7E1BVv+daIt uOF379nXHlyFMEjN6Uksd9kr5QqWZw98NoWx/kI/WP7qyET/ouo7kvwzRT2jgJCR+bxu04lQIXWYf Qk/ZBuRvotjK8PvlB2nKx9UFxIqtPbQJEEbcKR8rhC0vwlpxOVz55tx4RCYiyJfTgjoNtFMCpbPk4 Zv9tNKPN+ce7J67R5aM60FCEc/F+tW24m1Ms5iZ6JTUU/1vXhcGx7H5jov+9jJ3szbPQjnImvpHjz TsayKVrYyeSRgKOj/dsZ8QgdI4Ye1CYQVIhOvGpnsV9dNbFHrF4s8SkAFh8r3pDu4TSjUkPdUypQS 5UXJsZvQ==; 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 1gpUUf-0001Np-Ie; Fri, 01 Feb 2019 08:48:13 +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 04/18] au1000_eth: pass struct device to DMA API functions Date: Fri, 1 Feb 2019 09:47:47 +0100 Message-Id: <20190201084801.10983-5-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/net/ethernet/amd/au1000_eth.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/amd/au1000_eth.c b/drivers/net/ethernet/amd/au1000_eth.c index e833d1b3fe18..e5073aeea06a 100644 --- a/drivers/net/ethernet/amd/au1000_eth.c +++ b/drivers/net/ethernet/amd/au1000_eth.c @@ -1167,7 +1167,7 @@ static int au1000_probe(struct platform_device *pdev) /* Allocate the data buffers * Snooping works fine with eth on all au1xxx */ - aup->vaddr = (u32)dma_alloc_attrs(NULL, MAX_BUF_SIZE * + aup->vaddr = (u32)dma_alloc_attrs(&pdev->dev, MAX_BUF_SIZE * (NUM_TX_BUFFS + NUM_RX_BUFFS), &aup->dma_addr, 0, DMA_ATTR_NON_CONSISTENT); @@ -1349,7 +1349,7 @@ static int au1000_probe(struct platform_device *pdev) err_remap2: iounmap(aup->mac); err_remap1: - dma_free_attrs(NULL, MAX_BUF_SIZE * (NUM_TX_BUFFS + NUM_RX_BUFFS), + dma_free_attrs(&pdev->dev, MAX_BUF_SIZE * (NUM_TX_BUFFS + NUM_RX_BUFFS), (void *)aup->vaddr, aup->dma_addr, DMA_ATTR_NON_CONSISTENT); err_vaddr: @@ -1383,7 +1383,7 @@ static int au1000_remove(struct platform_device *pdev) if (aup->tx_db_inuse[i]) au1000_ReleaseDB(aup, aup->tx_db_inuse[i]); - dma_free_attrs(NULL, MAX_BUF_SIZE * (NUM_TX_BUFFS + NUM_RX_BUFFS), + dma_free_attrs(&pdev->dev, MAX_BUF_SIZE * (NUM_TX_BUFFS + NUM_RX_BUFFS), (void *)aup->vaddr, aup->dma_addr, DMA_ATTR_NON_CONSISTENT); -- 2.20.1