Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp146159ima; Fri, 1 Feb 2019 00:50:56 -0800 (PST) X-Google-Smtp-Source: ALg8bN6FUkX9Ebj3GX9bP6QkAGDT/svhJ8s0dqY3E7BquOwSp+AUFfRcfPfdm0Zuoa1+OYtJSiST X-Received: by 2002:a62:1112:: with SMTP id z18mr38008701pfi.173.1549011056564; Fri, 01 Feb 2019 00:50:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549011056; cv=none; d=google.com; s=arc-20160816; b=HJCNMLaA/pPUACivtYyT4aXp+P4XVMgm5udvCRy37cBMEmIu/LNo0ZDWrET9J0+IZ9 tgALf3HwKuFEy+S3KUkoWfqKr7jX7YxDqaHsZakOFK8/XNAuKl6ImKxTQb7LcL7Nxeof tcgBEF8r2hici8RvCP4fKFKMw4qK7x+QjnNfCKb3t3ApxzcZtW7Cq5Fs/WifeVpkm4AE 0Q43NXoLr4BTfl/ZaEFqRbxDKbS0ZNEc7zxSXSe0gN9j9MUYQ0tIcDkw1+UxZHJNbJK6 4rv8NVbK+9BX1raGh3LoEE6g3v8flbC0nY4K/fQPlnBw0M40KSyNNb8iEcjxR6smRmZZ qtlg== 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=jvXh2nGWWDi+i97GyziQAoz/cRdsHOCxPPGJzQv4Lzs=; b=CcZJLECge7BwpqdP/M4ieyotJ6JH0q4C0gFURYR+ARzwX9HQdJlH+iXTqx3/MpwdO2 pEvT8n453KjZz7wL/Et/DMO82SVwP1HvTM9RsQKdZvh8PqTFJR0a3J1A0JsNerlh+yh+ ygaHv5LMvtNol2T2YbhVoJKothIVMl9u013mhqs0WSgB/2PG+Fj27WA0akBEZXw+8O/5 iKF6pNEqUu9ANzNoLR7BOTjU+nndry3ZZzgG5Y/lvLYBpUcYZPv7A74MfImoNgNocS+E nSNnobZ5ek4ru5c2uma2M7MQRyKpqMffz6rApHoy4/PaWhWmAutNI1wPB2zx1mhx5NZy g8bA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=kPHcfP0x; 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 a13si6658886pgh.561.2019.02.01.00.50.40; Fri, 01 Feb 2019 00:50:56 -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=kPHcfP0x; 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 S1729642AbfBAIsf (ORCPT + 99 others); Fri, 1 Feb 2019 03:48:35 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:48446 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729597AbfBAIsd (ORCPT ); Fri, 1 Feb 2019 03:48:33 -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=jvXh2nGWWDi+i97GyziQAoz/cRdsHOCxPPGJzQv4Lzs=; b=kPHcfP0xs6RjXXDCs6UAZv01hT fs4kz/psbq6xjiMLPEmNEiprZdYKLWI19K1N/XLD5pkb6yD5mp7kjpZkr1KNj+lpZ+ZghM8kfVc3V kGg77BqmYfbSgMYzMAIcNy991S+Z/Lq0VVMRfqP8z7WwPXYZlcZk6Mn8Qj+MTsjRHx0IGoQ8zLGCP 9nl189pv9ng2b5oSxj7i2ldJZLTXzyrm9qSnheSDWWjUHxOjbsdWVMn/AdN8S7u0g8WOTdA0AE1/q 34R5JbVilnFazJiI/iRgSOzmQlnPS38gz1Ehbivx4pxPkuqMtSwO1Q0RpTnYMZ7ky4vwgwozRP1ez Az2+f4nA==; 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 1gpUUv-0001Rh-AG; Fri, 01 Feb 2019 08:48:29 +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 10/18] smc911x: pass struct device to DMA API functions Date: Fri, 1 Feb 2019 09:47:53 +0100 Message-Id: <20190201084801.10983-11-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/smsc/smc911x.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/smsc/smc911x.c b/drivers/net/ethernet/smsc/smc911x.c index 8355dfbb8ec3..b550e624500d 100644 --- a/drivers/net/ethernet/smsc/smc911x.c +++ b/drivers/net/ethernet/smsc/smc911x.c @@ -1188,7 +1188,7 @@ smc911x_tx_dma_irq(void *data) DBG(SMC_DEBUG_TX | SMC_DEBUG_DMA, dev, "TX DMA irq handler\n"); BUG_ON(skb == NULL); - dma_unmap_single(NULL, tx_dmabuf, tx_dmalen, DMA_TO_DEVICE); + dma_unmap_single(lp->dev, tx_dmabuf, tx_dmalen, DMA_TO_DEVICE); netif_trans_update(dev); dev_kfree_skb_irq(skb); lp->current_tx_skb = NULL; @@ -1219,7 +1219,7 @@ smc911x_rx_dma_irq(void *data) DBG(SMC_DEBUG_FUNC, dev, "--> %s\n", __func__); DBG(SMC_DEBUG_RX | SMC_DEBUG_DMA, dev, "RX DMA irq handler\n"); - dma_unmap_single(NULL, rx_dmabuf, rx_dmalen, DMA_FROM_DEVICE); + dma_unmap_single(lp->dev, rx_dmabuf, rx_dmalen, DMA_FROM_DEVICE); BUG_ON(skb == NULL); lp->current_rx_skb = NULL; PRINT_PKT(skb->data, skb->len); -- 2.20.1