Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1683826

[PATCH/RFC] dma-mapping: Provide dummy set_dma_ops() for NO_DMA=y

Path csiph.com!weretis.net!feeder4.news.weretis.net!newsfeed.CARNet.hr!news.spin.it!bofh.it!news.nic.it!robomod
From Geert Uytterhoeven <geert@linux-m68k.org>
Newsgroups linux.kernel
Subject [PATCH/RFC] dma-mapping: Provide dummy set_dma_ops() for NO_DMA=y
Date Sun, 09 Jul 2017 21:40:01 +0200
Message-ID <u1qdH-3o7-5@gated-at.bofh.it> (permalink)
X-Original-To Christoph Hellwig <hch@lst.de>, Marek Szyprowski <m.szyprowski@samsung.com>, Robin Murphy <robin.murphy@arm.com>, Madalin Bucur <madalin.bucur@nxp.com>, "David S . Miller" <davem@davemloft.net>, Arnd Bergmann <arnd@arndb.de>
X-Mailer git-send-email 2.7.4
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 30
Organization linux.* mail to news gateway
X-Original-Cc netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven <geert@linux-m68k.org>
X-Original-Date Sun, 9 Jul 2017 21:33:45 +0200
X-Original-Message-ID <1499628825-16260-1-git-send-email-geert@linux-m68k.org>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1683826

Show key headers only | View raw


Adding a dummy for set_dma_ops() allows to compile (sub)drivers that
don't actually use the DMA API, but propagate DMA ops configuration to a
second driver that may or may not use the DMA API.  Of course the second
driver does have to depend on HAS_DMA if it uses the DMA API.

An example is commit 5567e989198b5a8d ("fsl/fman: propagate dma_ops").

This allows to revert commit 85688d9adf685572 ("fsl/fman: add dependency
on HAS_DMA").

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 include/linux/dma-mapping.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index 843ab866e0f487c2..0ab244b954418e2b 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -194,6 +194,8 @@ static inline const struct dma_map_ops *get_dma_ops(struct device *dev)
 {
 	return &bad_dma_ops;
 }
+static inline void set_dma_ops(struct device *dev,
+			       const struct dma_map_ops *dma_ops) {}
 #endif
 
 static inline dma_addr_t dma_map_single_attrs(struct device *dev, void *ptr,
-- 
2.7.4

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH/RFC] dma-mapping: Provide dummy set_dma_ops() for NO_DMA=y Geert Uytterhoeven <geert@linux-m68k.org> - 2017-07-09 21:40 +0200
  Re: [PATCH/RFC] dma-mapping: Provide dummy set_dma_ops() for NO_DMA=y Arnd Bergmann <arnd@arndb.de> - 2017-07-10 10:00 +0200
  Re: [PATCH/RFC] dma-mapping: Provide dummy set_dma_ops() for         NO_DMA=y Christoph Hellwig <hch@lst.de> - 2017-07-10 17:00 +0200
    Re: [PATCH/RFC] dma-mapping: Provide dummy set_dma_ops() for NO_DMA=y Robin Murphy <robin.murphy@arm.com> - 2017-07-10 17:40 +0200
      Re: [PATCH/RFC] dma-mapping: Provide dummy set_dma_ops() for         NO_DMA=y Christoph Hellwig <hch@lst.de> - 2017-07-11 16:10 +0200

csiph-web