linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
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>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Geert Uytterhoeven <geert@linux-m68k.org>
Subject: [PATCH/RFC] dma-mapping: Provide dummy set_dma_ops() for NO_DMA=y
Date: Sun,  9 Jul 2017 21:33:45 +0200	[thread overview]
Message-ID: <1499628825-16260-1-git-send-email-geert@linux-m68k.org> (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

             reply	other threads:[~2017-07-09 19:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-09 19:33 Geert Uytterhoeven [this message]
2017-07-10  7:55 ` [PATCH/RFC] dma-mapping: Provide dummy set_dma_ops() for NO_DMA=y Arnd Bergmann
2017-07-10 14:56 ` Christoph Hellwig
2017-07-10 15:31   ` Robin Murphy
2017-07-11 14:02     ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1499628825-16260-1-git-send-email-geert@linux-m68k.org \
    --to=geert@linux-m68k.org \
    --cc=arnd@arndb.de \
    --cc=davem@davemloft.net \
    --cc=hch@lst.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=madalin.bucur@nxp.com \
    --cc=netdev@vger.kernel.org \
    --cc=robin.murphy@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).