linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [V3] mmc: mmci: add missing include of mmci_qcom_dml.h
@ 2016-06-16 18:47 Ben Dooks
  2016-06-16 18:50 ` Ben Dooks
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Ben Dooks @ 2016-06-16 18:47 UTC (permalink / raw)
  To: linux-arm-kernel

Fix the missing declarations of dml_start_xfer() and
dml_hw_init() by including mmci_qcom_dml.h to fix the
following warnings:

drivers/mmc/host/mmci_qcom_dml.c:57:6: warning: symbol 'dml_start_xfer' was not declared. Should it be static?
drivers/mmc/host/mmci_qcom_dml.c:122:5: warning: symbol 'dml_hw_init' was not declared. Should it be static?

Since the module build doesn't export symbols, also
export the symbols from the mmci_qcom_dml.c file as
otherwise the module link process won't work.

It is possible this also fixes up module loading when
both drivers are built as modules and not inserted in
the correct order.

Note, since this is a very small addition to the mmci
module, it would better to build it into the main mmci
driver (either by direct copy, or multiple linked
module)

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
---
V1..V2:
  - deal with module build errors
V2..V3:
  - add original authour and update list of recipients
---
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: Ulf Hansson <ulf.hansson@linaro.org>
Cc: linux-mmc at vger.kernel.org
Cc: linux-arm-kernel at lists.infradead.org
---
 drivers/mmc/host/mmci_qcom_dml.c | 3 +++
 drivers/mmc/host/mmci_qcom_dml.h | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/mmci_qcom_dml.c b/drivers/mmc/host/mmci_qcom_dml.c
index 2b7fc37..06858bd 100644
--- a/drivers/mmc/host/mmci_qcom_dml.c
+++ b/drivers/mmc/host/mmci_qcom_dml.c
@@ -18,6 +18,7 @@
 #include <linux/mmc/host.h>
 #include <linux/mmc/card.h>
 #include "mmci.h"
+#include "mmci_qcom_dml.h"
 
 /* Registers */
 #define DML_CONFIG			0x00
@@ -97,6 +98,7 @@ void dml_start_xfer(struct mmci_host *host, struct mmc_data *data)
 	/* make sure the dml is configured before dma is triggered */
 	wmb();
 }
+EXPORT_SYMBOL_GPL(dml_start_xfer);
 
 static int of_get_dml_pipe_index(struct device_node *np, const char *name)
 {
@@ -175,3 +177,4 @@ int dml_hw_init(struct mmci_host *host, struct device_node *np)
 
 	return 0;
 }
+EXPORT_SYMBOL_GPL(dml_hw_init);
diff --git a/drivers/mmc/host/mmci_qcom_dml.h b/drivers/mmc/host/mmci_qcom_dml.h
index 6e405d0..d77873d 100644
--- a/drivers/mmc/host/mmci_qcom_dml.h
+++ b/drivers/mmc/host/mmci_qcom_dml.h
@@ -15,7 +15,7 @@
 #ifndef __MMC_QCOM_DML_H__
 #define __MMC_QCOM_DML_H__
 
-#ifdef CONFIG_MMC_QCOM_DML
+#if defined(CONFIG_MMC_QCOM_DML) || defined(CONFIG_MMC_QCOM_DML_MODULE)
 int dml_hw_init(struct mmci_host *host, struct device_node *np);
 void dml_start_xfer(struct mmci_host *host, struct mmc_data *data);
 #else
-- 
2.8.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] [V3] mmc: mmci: add missing include of mmci_qcom_dml.h
  2016-06-16 18:47 [PATCH] [V3] mmc: mmci: add missing include of mmci_qcom_dml.h Ben Dooks
@ 2016-06-16 18:50 ` Ben Dooks
  2016-06-17  8:08 ` Srinivas Kandagatla
  2016-06-17 11:41 ` Arnd Bergmann
  2 siblings, 0 replies; 4+ messages in thread
From: Ben Dooks @ 2016-06-16 18:50 UTC (permalink / raw)
  To: linux-arm-kernel

On 16/06/16 19:47, Ben Dooks wrote:
> Fix the missing declarations of dml_start_xfer() and
> dml_hw_init() by including mmci_qcom_dml.h to fix the
> following warnings:
> 
> drivers/mmc/host/mmci_qcom_dml.c:57:6: warning: symbol 'dml_start_xfer' was not declared. Should it be static?
> drivers/mmc/host/mmci_qcom_dml.c:122:5: warning: symbol 'dml_hw_init' was not declared. Should it be static?
> 
> Since the module build doesn't export symbols, also
> export the symbols from the mmci_qcom_dml.c file as
> otherwise the module link process won't work.
> 
> It is possible this also fixes up module loading when
> both drivers are built as modules and not inserted in
> the correct order.
> 
> Note, since this is a very small addition to the mmci
> module, it would better to build it into the main mmci
> driver (either by direct copy, or multiple linked
> module)
> 
> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
> ---
> V1..V2:
>   - deal with module build errors
> V2..V3:
>   - add original authour and update list of recipients
> ---

I'm now wondering if I should split it into fixup the
module issues and fix the include once those are fixed.
Anyone want to comment?

> Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> Cc: Ulf Hansson <ulf.hansson@linaro.org>
> Cc: linux-mmc at vger.kernel.org
> Cc: linux-arm-kernel at lists.infradead.org
> ---
>  drivers/mmc/host/mmci_qcom_dml.c | 3 +++
>  drivers/mmc/host/mmci_qcom_dml.h | 2 +-
>  2 files changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/host/mmci_qcom_dml.c b/drivers/mmc/host/mmci_qcom_dml.c
> index 2b7fc37..06858bd 100644
> --- a/drivers/mmc/host/mmci_qcom_dml.c
> +++ b/drivers/mmc/host/mmci_qcom_dml.c
> @@ -18,6 +18,7 @@
>  #include <linux/mmc/host.h>
>  #include <linux/mmc/card.h>
>  #include "mmci.h"
> +#include "mmci_qcom_dml.h"
>  
>  /* Registers */
>  #define DML_CONFIG			0x00
> @@ -97,6 +98,7 @@ void dml_start_xfer(struct mmci_host *host, struct mmc_data *data)
>  	/* make sure the dml is configured before dma is triggered */
>  	wmb();
>  }
> +EXPORT_SYMBOL_GPL(dml_start_xfer);
>  
>  static int of_get_dml_pipe_index(struct device_node *np, const char *name)
>  {
> @@ -175,3 +177,4 @@ int dml_hw_init(struct mmci_host *host, struct device_node *np)
>  
>  	return 0;
>  }
> +EXPORT_SYMBOL_GPL(dml_hw_init);
> diff --git a/drivers/mmc/host/mmci_qcom_dml.h b/drivers/mmc/host/mmci_qcom_dml.h
> index 6e405d0..d77873d 100644
> --- a/drivers/mmc/host/mmci_qcom_dml.h
> +++ b/drivers/mmc/host/mmci_qcom_dml.h
> @@ -15,7 +15,7 @@
>  #ifndef __MMC_QCOM_DML_H__
>  #define __MMC_QCOM_DML_H__
>  
> -#ifdef CONFIG_MMC_QCOM_DML
> +#if defined(CONFIG_MMC_QCOM_DML) || defined(CONFIG_MMC_QCOM_DML_MODULE)
>  int dml_hw_init(struct mmci_host *host, struct device_node *np);
>  void dml_start_xfer(struct mmci_host *host, struct mmc_data *data);
>  #else
> 


-- 
Ben Dooks				http://www.codethink.co.uk/
Senior Engineer				Codethink - Providing Genius

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] [V3] mmc: mmci: add missing include of mmci_qcom_dml.h
  2016-06-16 18:47 [PATCH] [V3] mmc: mmci: add missing include of mmci_qcom_dml.h Ben Dooks
  2016-06-16 18:50 ` Ben Dooks
@ 2016-06-17  8:08 ` Srinivas Kandagatla
  2016-06-17 11:41 ` Arnd Bergmann
  2 siblings, 0 replies; 4+ messages in thread
From: Srinivas Kandagatla @ 2016-06-17  8:08 UTC (permalink / raw)
  To: linux-arm-kernel

Thanks for the patch.

On 16/06/16 19:47, Ben Dooks wrote:
> Fix the missing declarations of dml_start_xfer() and
> dml_hw_init() by including mmci_qcom_dml.h to fix the
> following warnings:
>
> drivers/mmc/host/mmci_qcom_dml.c:57:6: warning: symbol 'dml_start_xfer' was not declared. Should it be static?
> drivers/mmc/host/mmci_qcom_dml.c:122:5: warning: symbol 'dml_hw_init' was not declared. Should it be static?
>
> Since the module build doesn't export symbols, also
> export the symbols from the mmci_qcom_dml.c file as
> otherwise the module link process won't work.
>
> It is possible this also fixes up module loading when
> both drivers are built as modules and not inserted in
> the correct order.
>
> Note, since this is a very small addition to the mmci
> module, it would better to build it into the main mmci
> driver (either by direct copy, or multiple linked
> module)
>
Let's fix this in a go, making it possible to insert this as a module.
As this patch only fixes a part of the problem.

Some comments below.

> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
> ---
> V1..V2:
>    - deal with module build errors
> V2..V3:
>    - add original authour and update list of recipients
> ---
> Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> Cc: Ulf Hansson <ulf.hansson@linaro.org>
> Cc: linux-mmc at vger.kernel.org
> Cc: linux-arm-kernel at lists.infradead.org
> ---
>   drivers/mmc/host/mmci_qcom_dml.c | 3 +++
>   drivers/mmc/host/mmci_qcom_dml.h | 2 +-
>   2 files changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/mmci_qcom_dml.c b/drivers/mmc/host/mmci_qcom_dml.c
> index 2b7fc37..06858bd 100644
> --- a/drivers/mmc/host/mmci_qcom_dml.c
> +++ b/drivers/mmc/host/mmci_qcom_dml.c
> @@ -18,6 +18,7 @@
>   #include <linux/mmc/host.h>
>   #include <linux/mmc/card.h>
>   #include "mmci.h"
also include
#include <linux/module.h>
> +#include "mmci_qcom_dml.h"
>
>   /* Registers */
>   #define DML_CONFIG			0x00
> @@ -97,6 +98,7 @@ void dml_start_xfer(struct mmci_host *host, struct mmc_data *data)
>   	/* make sure the dml is configured before dma is triggered */
>   	wmb();
>   }
> +EXPORT_SYMBOL_GPL(dml_start_xfer);
>
>   static int of_get_dml_pipe_index(struct device_node *np, const char *name)
>   {
> @@ -175,3 +177,4 @@ int dml_hw_init(struct mmci_host *host, struct device_node *np)
>
>   	return 0;
>   }
> +EXPORT_SYMBOL_GPL(dml_hw_init);

You would also need this at the end of the file, to be able to 
successfully insert the module.

MODULE_DESCRIPTION("QCOM DML Driver");
MODULE_LICENSE("GPL v2");
> diff --git a/drivers/mmc/host/mmci_qcom_dml.h b/drivers/mmc/host/mmci_qcom_dml.h
> index 6e405d0..d77873d 100644
> --- a/drivers/mmc/host/mmci_qcom_dml.h
> +++ b/drivers/mmc/host/mmci_qcom_dml.h
> @@ -15,7 +15,7 @@
>   #ifndef __MMC_QCOM_DML_H__
>   #define __MMC_QCOM_DML_H__
>
> -#ifdef CONFIG_MMC_QCOM_DML
> +#if defined(CONFIG_MMC_QCOM_DML) || defined(CONFIG_MMC_QCOM_DML_MODULE)

should be
#if IS_ENABLED(CONFIG_MMC_QCOM_DML)

>   int dml_hw_init(struct mmci_host *host, struct device_node *np);
>   void dml_start_xfer(struct mmci_host *host, struct mmc_data *data);
>   #else
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] [V3] mmc: mmci: add missing include of mmci_qcom_dml.h
  2016-06-16 18:47 [PATCH] [V3] mmc: mmci: add missing include of mmci_qcom_dml.h Ben Dooks
  2016-06-16 18:50 ` Ben Dooks
  2016-06-17  8:08 ` Srinivas Kandagatla
@ 2016-06-17 11:41 ` Arnd Bergmann
  2 siblings, 0 replies; 4+ messages in thread
From: Arnd Bergmann @ 2016-06-17 11:41 UTC (permalink / raw)
  To: linux-arm-kernel

On Thursday, June 16, 2016 7:47:32 PM CEST Ben Dooks wrote:

> Note, since this is a very small addition to the mmci
> module, it would better to build it into the main mmci
> driver (either by direct copy, or multiple linked
> module)

I suspect the latter is actually what the author intended,
except they accidentally made the symbol tristate and got the
Makefile logic wrong.

Most likely, the qcom developers never considered the case
of having loadable modules.

	Arnd

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-06-17 11:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-16 18:47 [PATCH] [V3] mmc: mmci: add missing include of mmci_qcom_dml.h Ben Dooks
2016-06-16 18:50 ` Ben Dooks
2016-06-17  8:08 ` Srinivas Kandagatla
2016-06-17 11:41 ` Arnd Bergmann

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).