All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chen Gang <gang.chen.5i5j@gmail.com>
To: stefanr@s5r6.in-berlin.de
Cc: linux1394-devel@lists.sourceforge.net,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Liqin Chen <liqin.linux@gmail.com>,
	Lennox Wu <lennox.wu@gmail.com>
Subject: [PATCH] drivers: firewire: Let several sub-modules depend on HAS_DMA
Date: Sun, 13 Jul 2014 11:06:44 +0800	[thread overview]
Message-ID: <53C1F7C4.2010901@gmail.com> (raw)

Several sub-modules of 'firewire' need HAS_DMA, so let them depend on it.
FIREWIRE_NET and FIREWIRE_OHCI use 'core-iso.c' which also needs HAS_DMA,
so need 'ifdef' the related function by CONFIG_HAS_DMA in 'core-iso.c'.

The related error (with allmodconfig under score):

    MODPOST 1365 modules
  ERROR: "dma_mapping_error" [drivers/firewire/firewire-sbp2.ko] undefined!
  ERROR: "dma_map_single" [drivers/firewire/firewire-sbp2.ko] undefined!
  ERROR: "dma_unmap_single" [drivers/firewire/firewire-sbp2.ko] undefined!
  ERROR: "scsi_dma_map" [drivers/firewire/firewire-sbp2.ko] undefined!
  ERROR: "scsi_dma_unmap" [drivers/firewire/firewire-sbp2.ko] undefined!
  ERROR: "dma_mapping_error" [drivers/firewire/firewire-core.ko] undefined!
  ERROR: "dma_map_page" [drivers/firewire/firewire-core.ko] undefined!
  ERROR: "dma_unmap_page" [drivers/firewire/firewire-core.ko] undefined!

Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
---
 drivers/firewire/Kconfig    |  6 +++---
 drivers/firewire/core-iso.c | 15 +++++++++++++++
 2 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/drivers/firewire/Kconfig b/drivers/firewire/Kconfig
index 4199849..fd75278 100644
--- a/drivers/firewire/Kconfig
+++ b/drivers/firewire/Kconfig
@@ -19,7 +19,7 @@ config FIREWIRE
 
 config FIREWIRE_OHCI
 	tristate "OHCI-1394 controllers"
-	depends on PCI && FIREWIRE && MMU
+	depends on PCI && FIREWIRE && MMU && HAS_DMA
 	help
 	  Enable this driver if you have a FireWire controller based
 	  on the OHCI specification.  For all practical purposes, this
@@ -30,7 +30,7 @@ config FIREWIRE_OHCI
 
 config FIREWIRE_SBP2
 	tristate "Storage devices (SBP-2 protocol)"
-	depends on FIREWIRE && SCSI
+	depends on FIREWIRE && SCSI && HAS_DMA
 	help
 	  This option enables you to use SBP-2 devices connected to a
 	  FireWire bus.  SBP-2 devices include storage devices like
@@ -45,7 +45,7 @@ config FIREWIRE_SBP2
 
 config FIREWIRE_NET
 	tristate "IP networking over 1394"
-	depends on FIREWIRE && INET
+	depends on FIREWIRE && INET && HAS_DMA
 	help
 	  This enables IPv4/IPv6 over IEEE 1394, providing IP connectivity
 	  with other implementations of RFC 2734/3146 as found on several
diff --git a/drivers/firewire/core-iso.c b/drivers/firewire/core-iso.c
index 38c0aa6..995f038 100644
--- a/drivers/firewire/core-iso.c
+++ b/drivers/firewire/core-iso.c
@@ -64,6 +64,7 @@ int fw_iso_buffer_alloc(struct fw_iso_buffer *buffer, int page_count)
 	return 0;
 }
 
+#ifdef CONFIG_HAS_DMA
 int fw_iso_buffer_map_dma(struct fw_iso_buffer *buffer, struct fw_card *card,
 			  enum dma_data_direction direction)
 {
@@ -86,6 +87,13 @@ int fw_iso_buffer_map_dma(struct fw_iso_buffer *buffer, struct fw_card *card,
 
 	return 0;
 }
+#else
+int fw_iso_buffer_map_dma(struct fw_iso_buffer *buffer, struct fw_card *card,
+			  enum dma_data_direction direction)
+{
+	return -ENXIO;
+}
+#endif
 
 int fw_iso_buffer_init(struct fw_iso_buffer *buffer, struct fw_card *card,
 		       int page_count, enum dma_data_direction direction)
@@ -122,6 +130,7 @@ int fw_iso_buffer_map_vma(struct fw_iso_buffer *buffer,
 	return 0;
 }
 
+#ifdef CONFIG_HAS_DMA
 void fw_iso_buffer_destroy(struct fw_iso_buffer *buffer,
 			   struct fw_card *card)
 {
@@ -141,6 +150,12 @@ void fw_iso_buffer_destroy(struct fw_iso_buffer *buffer,
 	buffer->page_count = 0;
 	buffer->page_count_mapped = 0;
 }
+#else
+void fw_iso_buffer_destroy(struct fw_iso_buffer *buffer,
+			   struct fw_card *card)
+{
+}
+#endif
 EXPORT_SYMBOL(fw_iso_buffer_destroy);
 
 /* Convert DMA address to offset into virtually contiguous buffer. */
-- 
1.7.11.7

             reply	other threads:[~2014-07-13  3:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-13  3:06 Chen Gang [this message]
2014-07-13  8:42 ` [PATCH] drivers: firewire: Let several sub-modules depend on HAS_DMA Stefan Richter
2014-07-13 10:19   ` Chen Gang

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=53C1F7C4.2010901@gmail.com \
    --to=gang.chen.5i5j@gmail.com \
    --cc=lennox.wu@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux1394-devel@lists.sourceforge.net \
    --cc=liqin.linux@gmail.com \
    --cc=stefanr@s5r6.in-berlin.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.