mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* spi_fsl_spi broken when compiled as module by b36ece832512c1a0afa54ff0a56d63492a1caf08
@ 2011-05-11 15:52 Lennart Sorensen
  2011-05-11 17:03 ` Lennart Sorensen
  2011-05-12  1:33 ` Hu Mingkai-B21284
  0 siblings, 2 replies; 10+ messages in thread
From: Lennart Sorensen @ 2011-05-11 15:52 UTC (permalink / raw)
  To: linux-kernel; +Cc: Mingkai Hu, Len Sorensen, Grant Likely

When code was refactored, spi_fsl_spi now depends on funfcionts in
spi-fsl_lib, but those are not exported symbols so when building as a
module the symbols are missing and the compile fails.

Adding these to spi_fsl_lib.c fixes the compile.

EXPORT_SYMBOL(mpc8xxx_spi_tx_buf_u32);
EXPORT_SYMBOL(mpc8xxx_spi_rx_buf_u32);
EXPORT_SYMBOL(mpc8xxx_spi_tx_buf_u16);
EXPORT_SYMBOL(mpc8xxx_spi_rx_buf_u16);
EXPORT_SYMBOL(mpc8xxx_spi_tx_buf_u8);
EXPORT_SYMBOL(mpc8xxx_spi_rx_buf_u8);
EXPORT_SYMBOL(mpc8xxx_spi_strmode);
EXPORT_SYMBOL(mpc8xxx_spi_probe);
EXPORT_SYMBOL(of_mpc8xxx_spi_probe);
EXPORT_SYMBOL(mpc8xxx_spi_remove);
EXPORT_SYMBOL(to_of_pinfo);

All releases since the refactoring was done would be affected.

-- 
Len Sorensen

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

* Re: spi_fsl_spi broken when compiled as module by b36ece832512c1a0afa54ff0a56d63492a1caf08
  2011-05-11 15:52 spi_fsl_spi broken when compiled as module by b36ece832512c1a0afa54ff0a56d63492a1caf08 Lennart Sorensen
@ 2011-05-11 17:03 ` Lennart Sorensen
  2011-05-12  1:33 ` Hu Mingkai-B21284
  1 sibling, 0 replies; 10+ messages in thread
From: Lennart Sorensen @ 2011-05-11 17:03 UTC (permalink / raw)
  To: Lennart Sorensen; +Cc: linux-kernel, Mingkai Hu, Grant Likely

On Wed, May 11, 2011 at 11:52:11AM -0400, Lennart Sorensen wrote:
> When code was refactored, spi_fsl_spi now depends on funfcionts in
> spi-fsl_lib, but those are not exported symbols so when building as a
> module the symbols are missing and the compile fails.
> 
> Adding these to spi_fsl_lib.c fixes the compile.
> 
> EXPORT_SYMBOL(mpc8xxx_spi_tx_buf_u32);
> EXPORT_SYMBOL(mpc8xxx_spi_rx_buf_u32);
> EXPORT_SYMBOL(mpc8xxx_spi_tx_buf_u16);
> EXPORT_SYMBOL(mpc8xxx_spi_rx_buf_u16);
> EXPORT_SYMBOL(mpc8xxx_spi_tx_buf_u8);
> EXPORT_SYMBOL(mpc8xxx_spi_rx_buf_u8);
> EXPORT_SYMBOL(mpc8xxx_spi_strmode);
> EXPORT_SYMBOL(mpc8xxx_spi_probe);
> EXPORT_SYMBOL(of_mpc8xxx_spi_probe);
> EXPORT_SYMBOL(mpc8xxx_spi_remove);
> EXPORT_SYMBOL(to_of_pinfo);
> 
> All releases since the refactoring was done would be affected.

Of course a MODULE_LICENSE("GPL"); helps too.

-- 
Len Sorensen

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

* RE: spi_fsl_spi broken when compiled as module by b36ece832512c1a0afa54ff0a56d63492a1caf08
  2011-05-11 15:52 spi_fsl_spi broken when compiled as module by b36ece832512c1a0afa54ff0a56d63492a1caf08 Lennart Sorensen
  2011-05-11 17:03 ` Lennart Sorensen
@ 2011-05-12  1:33 ` Hu Mingkai-B21284
  2011-05-12 15:11   ` Lennart Sorensen
  1 sibling, 1 reply; 10+ messages in thread
From: Hu Mingkai-B21284 @ 2011-05-12  1:33 UTC (permalink / raw)
  To: Lennart Sorensen, linux-kernel; +Cc: Grant Likely

Hi Len,

Please submit a patch to modify it.

Thanks,
Mingkai

> -----Original Message-----
> From: Lennart Sorensen [mailto:lsorense@csclub.uwaterloo.ca]
> Sent: Wednesday, May 11, 2011 11:52 PM
> To: linux-kernel@vger.kernel.org
> Cc: Hu Mingkai-B21284; Len Sorensen; Grant Likely
> Subject: spi_fsl_spi broken when compiled as module by
> b36ece832512c1a0afa54ff0a56d63492a1caf08
> 
> When code was refactored, spi_fsl_spi now depends on funfcionts in spi-
> fsl_lib, but those are not exported symbols so when building as a module
> the symbols are missing and the compile fails.
> 
> Adding these to spi_fsl_lib.c fixes the compile.
> 
> EXPORT_SYMBOL(mpc8xxx_spi_tx_buf_u32);
> EXPORT_SYMBOL(mpc8xxx_spi_rx_buf_u32);
> EXPORT_SYMBOL(mpc8xxx_spi_tx_buf_u16);
> EXPORT_SYMBOL(mpc8xxx_spi_rx_buf_u16);
> EXPORT_SYMBOL(mpc8xxx_spi_tx_buf_u8);
> EXPORT_SYMBOL(mpc8xxx_spi_rx_buf_u8);
> EXPORT_SYMBOL(mpc8xxx_spi_strmode);
> EXPORT_SYMBOL(mpc8xxx_spi_probe);
> EXPORT_SYMBOL(of_mpc8xxx_spi_probe);
> EXPORT_SYMBOL(mpc8xxx_spi_remove);
> EXPORT_SYMBOL(to_of_pinfo);
> 
> All releases since the refactoring was done would be affected.
> 
> --
> Len Sorensen



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

* Re: spi_fsl_spi broken when compiled as module by b36ece832512c1a0afa54ff0a56d63492a1caf08
  2011-05-12  1:33 ` Hu Mingkai-B21284
@ 2011-05-12 15:11   ` Lennart Sorensen
  2011-05-16  2:10     ` Hu Mingkai-B21284
  2011-05-16 18:17     ` Grant Likely
  0 siblings, 2 replies; 10+ messages in thread
From: Lennart Sorensen @ 2011-05-12 15:11 UTC (permalink / raw)
  To: Hu Mingkai-B21284
  Cc: Lennart Sorensen, linux-kernel, Grant Likely, Kumar Gala

On Thu, May 12, 2011 at 01:33:55AM +0000, Hu Mingkai-B21284 wrote:
> Please submit a patch to modify it.

OK.  Here it is.

-- 
Len Sorensen

Add missing exports and module license to allow compiling of spi_fsl_*
drivers as modules again.  Originally broken by refactoring of code in
b36ece832512c1a0afa54ff0a56d63492a1caf08.

diff --git a/drivers/spi/spi_fsl_lib.c b/drivers/spi/spi_fsl_lib.c
index ff59f42..d7efaac 100644
--- a/drivers/spi/spi_fsl_lib.c
+++ b/drivers/spi/spi_fsl_lib.c
@@ -48,16 +48,23 @@ u32 mpc8xxx_spi_tx_buf_##type(struct mpc8xxx_spi *mpc8xxx_spi)	\
 }
 
 MPC8XXX_SPI_RX_BUF(u8)
+EXPORT_SYMBOL(mpc8xxx_spi_rx_buf_u8);
 MPC8XXX_SPI_RX_BUF(u16)
+EXPORT_SYMBOL(mpc8xxx_spi_rx_buf_u16);                                                                                                                                                                                                                                       
 MPC8XXX_SPI_RX_BUF(u32)
+EXPORT_SYMBOL(mpc8xxx_spi_rx_buf_u32);                                                                                                                                                                                                                                       
 MPC8XXX_SPI_TX_BUF(u8)
+EXPORT_SYMBOL(mpc8xxx_spi_tx_buf_u8);                                                                                                                                                                                                                                        
 MPC8XXX_SPI_TX_BUF(u16)
+EXPORT_SYMBOL(mpc8xxx_spi_tx_buf_u16);                                                                                                                                                                                                                                       
 MPC8XXX_SPI_TX_BUF(u32)
+EXPORT_SYMBOL(mpc8xxx_spi_tx_buf_u32);                                                                                                                                                                                                                                       
 
 struct mpc8xxx_spi_probe_info *to_of_pinfo(struct fsl_spi_platform_data *pdata)
 {
 	return container_of(pdata, struct mpc8xxx_spi_probe_info, pdata);
 }
+EXPORT_SYMBOL(to_of_pinfo);
 
 void mpc8xxx_spi_work(struct work_struct *work)
 {
@@ -116,6 +123,7 @@ const char *mpc8xxx_spi_strmode(unsigned int flags)
 	}
 	return "CPU";
 }
+EXPORT_SYMBOL(mpc8xxx_spi_strmode);                                                                                                                                                                                                                                          
 
 int mpc8xxx_spi_probe(struct device *dev, struct resource *mem,
 			unsigned int irq)
@@ -168,6 +176,7 @@ int mpc8xxx_spi_probe(struct device *dev, struct resource *mem,
 err:
 	return ret;
 }
+EXPORT_SYMBOL(mpc8xxx_spi_probe);                                                                                                                                                                                                                                            
 
 int __devexit mpc8xxx_spi_remove(struct device *dev)
 {
@@ -188,6 +197,7 @@ int __devexit mpc8xxx_spi_remove(struct device *dev)
 
 	return 0;
 }
+EXPORT_SYMBOL(mpc8xxx_spi_remove);                                                                                                                                                                                                                                           
 
 int __devinit of_mpc8xxx_spi_probe(struct platform_device *ofdev)
 {
@@ -234,3 +244,8 @@ err:
 	kfree(pinfo);
 	return ret;
 }
+EXPORT_SYMBOL(of_mpc8xxx_spi_probe);                                                                                                                                                                                                                                         
+
+MODULE_AUTHOR("Kumar Gala");
+MODULE_DESCRIPTION("Freescale SPI/eSPI controller driver library");
+MODULE_LICENSE("GPL");

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

* RE: spi_fsl_spi broken when compiled as module by b36ece832512c1a0afa54ff0a56d63492a1caf08
  2011-05-12 15:11   ` Lennart Sorensen
@ 2011-05-16  2:10     ` Hu Mingkai-B21284
  2011-05-16  2:17       ` Randy Dunlap
  2011-05-16 16:52       ` Lennart Sorensen
  2011-05-16 18:17     ` Grant Likely
  1 sibling, 2 replies; 10+ messages in thread
From: Hu Mingkai-B21284 @ 2011-05-16  2:10 UTC (permalink / raw)
  To: Lennart Sorensen; +Cc: linux-kernel, Grant Likely, Kumar Gala

Hi len,

You can prepare the patch using git tool and send it to the maillist.
Also add spi-devel-general@lists.sourceforge.net maillist.

Thanks,
Mingkai

> -----Original Message-----
> From: Lennart Sorensen [mailto:lsorense@csclub.uwaterloo.ca]
> Sent: Thursday, May 12, 2011 11:11 PM
> To: Hu Mingkai-B21284
> Cc: Lennart Sorensen; linux-kernel@vger.kernel.org; Grant Likely; Kumar
> Gala
> Subject: Re: spi_fsl_spi broken when compiled as module by
> b36ece832512c1a0afa54ff0a56d63492a1caf08
> 
> On Thu, May 12, 2011 at 01:33:55AM +0000, Hu Mingkai-B21284 wrote:
> > Please submit a patch to modify it.
> 
> OK.  Here it is.
> 
> --
> Len Sorensen
> 
> Add missing exports and module license to allow compiling of spi_fsl_*
> drivers as modules again.  Originally broken by refactoring of code in
> b36ece832512c1a0afa54ff0a56d63492a1caf08.
> 
> diff --git a/drivers/spi/spi_fsl_lib.c b/drivers/spi/spi_fsl_lib.c index
> ff59f42..d7efaac 100644
> --- a/drivers/spi/spi_fsl_lib.c
> +++ b/drivers/spi/spi_fsl_lib.c
> @@ -48,16 +48,23 @@ u32 mpc8xxx_spi_tx_buf_##type(struct mpc8xxx_spi
> *mpc8xxx_spi)	\
>  }
> 
>  MPC8XXX_SPI_RX_BUF(u8)
> +EXPORT_SYMBOL(mpc8xxx_spi_rx_buf_u8);
>  MPC8XXX_SPI_RX_BUF(u16)
> +EXPORT_SYMBOL(mpc8xxx_spi_rx_buf_u16);
>  MPC8XXX_SPI_RX_BUF(u32)
> +EXPORT_SYMBOL(mpc8xxx_spi_rx_buf_u32);
>  MPC8XXX_SPI_TX_BUF(u8)
> +EXPORT_SYMBOL(mpc8xxx_spi_tx_buf_u8);
>  MPC8XXX_SPI_TX_BUF(u16)
> +EXPORT_SYMBOL(mpc8xxx_spi_tx_buf_u16);
>  MPC8XXX_SPI_TX_BUF(u32)
> +EXPORT_SYMBOL(mpc8xxx_spi_tx_buf_u32);
> 
>  struct mpc8xxx_spi_probe_info *to_of_pinfo(struct fsl_spi_platform_data
> *pdata)  {
>  	return container_of(pdata, struct mpc8xxx_spi_probe_info, pdata);  }
> +EXPORT_SYMBOL(to_of_pinfo);
> 
>  void mpc8xxx_spi_work(struct work_struct *work)  { @@ -116,6 +123,7 @@
> const char *mpc8xxx_spi_strmode(unsigned int flags)
>  	}
>  	return "CPU";
>  }
> +EXPORT_SYMBOL(mpc8xxx_spi_strmode);
> 
>  int mpc8xxx_spi_probe(struct device *dev, struct resource *mem,
>  			unsigned int irq)
> @@ -168,6 +176,7 @@ int mpc8xxx_spi_probe(struct device *dev, struct
> resource *mem,
>  err:
>  	return ret;
>  }
> +EXPORT_SYMBOL(mpc8xxx_spi_probe);
> 
>  int __devexit mpc8xxx_spi_remove(struct device *dev)  { @@ -188,6 +197,7
> @@ int __devexit mpc8xxx_spi_remove(struct device *dev)
> 
>  	return 0;
>  }
> +EXPORT_SYMBOL(mpc8xxx_spi_remove);
> 
>  int __devinit of_mpc8xxx_spi_probe(struct platform_device *ofdev)  { @@ -
> 234,3 +244,8 @@ err:
>  	kfree(pinfo);
>  	return ret;
>  }
> +EXPORT_SYMBOL(of_mpc8xxx_spi_probe);
> +
> +MODULE_AUTHOR("Kumar Gala");
> +MODULE_DESCRIPTION("Freescale SPI/eSPI controller driver library");
> +MODULE_LICENSE("GPL");



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

* RE: spi_fsl_spi broken when compiled as module by b36ece832512c1a0afa54ff0a56d63492a1caf08
  2011-05-16  2:10     ` Hu Mingkai-B21284
@ 2011-05-16  2:17       ` Randy Dunlap
  2011-05-16 16:52       ` Lennart Sorensen
  1 sibling, 0 replies; 10+ messages in thread
From: Randy Dunlap @ 2011-05-16  2:17 UTC (permalink / raw)
  To: Hu Mingkai-B21284
  Cc: Lennart Sorensen, linux-kernel, Grant Likely, Kumar Gala

On Sun, May 15, 2011 7:10 pm, Hu Mingkai-B21284 wrote:
> Hi len,
>
> You can prepare the patch using git tool and send it to the maillist.

Hi,

What do you mean by this?  In the past there has been no
requirement for individual patch submitters to use git
(whereas tree maintainers might be so required).

Are you implying that using git is required for some
kernel patches?

Thanks.


> Also add spi-devel-general@lists.sourceforge.net maillist.
>
> Thanks,
> Mingkai
>
>> -----Original Message-----
>> From: Lennart Sorensen [mailto:lsorense@csclub.uwaterloo.ca]
>> Sent: Thursday, May 12, 2011 11:11 PM
>> To: Hu Mingkai-B21284
>> Cc: Lennart Sorensen; linux-kernel@vger.kernel.org; Grant Likely; Kumar
>> Gala
>> Subject: Re: spi_fsl_spi broken when compiled as module by
>> b36ece832512c1a0afa54ff0a56d63492a1caf08
>>
>> On Thu, May 12, 2011 at 01:33:55AM +0000, Hu Mingkai-B21284 wrote:
>> > Please submit a patch to modify it.
>>
>> OK.  Here it is.
>>
>> --
>> Len Sorensen
>>
>> Add missing exports and module license to allow compiling of spi_fsl_*
>> drivers as modules again.  Originally broken by refactoring of code in
>> b36ece832512c1a0afa54ff0a56d63492a1caf08.
>>
>> diff --git a/drivers/spi/spi_fsl_lib.c b/drivers/spi/spi_fsl_lib.c index
>> ff59f42..d7efaac 100644
>> --- a/drivers/spi/spi_fsl_lib.c
>> +++ b/drivers/spi/spi_fsl_lib.c
>> @@ -48,16 +48,23 @@ u32 mpc8xxx_spi_tx_buf_##type(struct mpc8xxx_spi
>> *mpc8xxx_spi)	\
>>  }
>>
>>  MPC8XXX_SPI_RX_BUF(u8)
>> +EXPORT_SYMBOL(mpc8xxx_spi_rx_buf_u8);
>>  MPC8XXX_SPI_RX_BUF(u16)
>> +EXPORT_SYMBOL(mpc8xxx_spi_rx_buf_u16);
>>  MPC8XXX_SPI_RX_BUF(u32)
>> +EXPORT_SYMBOL(mpc8xxx_spi_rx_buf_u32);
>>  MPC8XXX_SPI_TX_BUF(u8)
>> +EXPORT_SYMBOL(mpc8xxx_spi_tx_buf_u8);
>>  MPC8XXX_SPI_TX_BUF(u16)
>> +EXPORT_SYMBOL(mpc8xxx_spi_tx_buf_u16);
>>  MPC8XXX_SPI_TX_BUF(u32)
>> +EXPORT_SYMBOL(mpc8xxx_spi_tx_buf_u32);
>>
>>  struct mpc8xxx_spi_probe_info *to_of_pinfo(struct fsl_spi_platform_data
>> *pdata)  {
>>  	return container_of(pdata, struct mpc8xxx_spi_probe_info, pdata);  }
>> +EXPORT_SYMBOL(to_of_pinfo);
>>
>>  void mpc8xxx_spi_work(struct work_struct *work)  { @@ -116,6 +123,7 @@
>> const char *mpc8xxx_spi_strmode(unsigned int flags)
>>  	}
>>  	return "CPU";
>>  }
>> +EXPORT_SYMBOL(mpc8xxx_spi_strmode);
>>
>>  int mpc8xxx_spi_probe(struct device *dev, struct resource *mem,
>>  			unsigned int irq)
>> @@ -168,6 +176,7 @@ int mpc8xxx_spi_probe(struct device *dev, struct
>> resource *mem,
>>  err:
>>  	return ret;
>>  }
>> +EXPORT_SYMBOL(mpc8xxx_spi_probe);
>>
>>  int __devexit mpc8xxx_spi_remove(struct device *dev)  { @@ -188,6
>> +197,7
>> @@ int __devexit mpc8xxx_spi_remove(struct device *dev)
>>
>>  	return 0;
>>  }
>> +EXPORT_SYMBOL(mpc8xxx_spi_remove);
>>
>>  int __devinit of_mpc8xxx_spi_probe(struct platform_device *ofdev)  { @@
>> -
>> 234,3 +244,8 @@ err:
>>  	kfree(pinfo);
>>  	return ret;
>>  }
>> +EXPORT_SYMBOL(of_mpc8xxx_spi_probe);
>> +
>> +MODULE_AUTHOR("Kumar Gala");
>> +MODULE_DESCRIPTION("Freescale SPI/eSPI controller driver library");
>> +MODULE_LICENSE("GPL");
>
>
> --


-- 
~Randy


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

* Re: spi_fsl_spi broken when compiled as module by b36ece832512c1a0afa54ff0a56d63492a1caf08
  2011-05-16  2:10     ` Hu Mingkai-B21284
  2011-05-16  2:17       ` Randy Dunlap
@ 2011-05-16 16:52       ` Lennart Sorensen
  1 sibling, 0 replies; 10+ messages in thread
From: Lennart Sorensen @ 2011-05-16 16:52 UTC (permalink / raw)
  To: Hu Mingkai-B21284
  Cc: Lennart Sorensen, linux-kernel, Grant Likely, Kumar Gala

On Mon, May 16, 2011 at 02:10:25AM +0000, Hu Mingkai-B21284 wrote:
> You can prepare the patch using git tool and send it to the maillist.
> Also add spi-devel-general@lists.sourceforge.net maillist.

Well I did prepare it with git the same way I have done all the other
patches I have sent of the last number of years.  No one has ever had
a problem with that.

If you mean have git send the email, then no that isn't going to happen
ever.  I don't run git on a machine that sends mail, and I don't run
git on the machine I do my email on.

The email is a valid patch, my email client doesn't screw up white space,
so there is no problem.

-- 
Len Sorensen

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

* Re: spi_fsl_spi broken when compiled as module by b36ece832512c1a0afa54ff0a56d63492a1caf08
  2011-05-12 15:11   ` Lennart Sorensen
  2011-05-16  2:10     ` Hu Mingkai-B21284
@ 2011-05-16 18:17     ` Grant Likely
  2011-05-16 19:52       ` Lennart Sorensen
  1 sibling, 1 reply; 10+ messages in thread
From: Grant Likely @ 2011-05-16 18:17 UTC (permalink / raw)
  To: Lennart Sorensen; +Cc: Hu Mingkai-B21284, linux-kernel, Kumar Gala

On Thu, May 12, 2011 at 9:11 AM, Lennart Sorensen
<lsorense@csclub.uwaterloo.ca> wrote:
> On Thu, May 12, 2011 at 01:33:55AM +0000, Hu Mingkai-B21284 wrote:
>> Please submit a patch to modify it.
>
> OK.  Here it is.

>
> --
> Len Sorensen
>
> Add missing exports and module license to allow compiling of spi_fsl_*
> drivers as modules again.  Originally broken by refactoring of code in
> b36ece832512c1a0afa54ff0a56d63492a1caf08.
>
> diff --git a/drivers/spi/spi_fsl_lib.c b/drivers/spi/spi_fsl_lib.c
> index ff59f42..d7efaac 100644
> --- a/drivers/spi/spi_fsl_lib.c
> +++ b/drivers/spi/spi_fsl_lib.c
> @@ -48,16 +48,23 @@ u32 mpc8xxx_spi_tx_buf_##type(struct mpc8xxx_spi *mpc8xxx_spi)      \
>  }
>
>  MPC8XXX_SPI_RX_BUF(u8)
> +EXPORT_SYMBOL(mpc8xxx_spi_rx_buf_u8);
>  MPC8XXX_SPI_RX_BUF(u16)
> +EXPORT_SYMBOL(mpc8xxx_spi_rx_buf_u16);
>  MPC8XXX_SPI_RX_BUF(u32)
> +EXPORT_SYMBOL(mpc8xxx_spi_rx_buf_u32);
>  MPC8XXX_SPI_TX_BUF(u8)
> +EXPORT_SYMBOL(mpc8xxx_spi_tx_buf_u8);
>  MPC8XXX_SPI_TX_BUF(u16)
> +EXPORT_SYMBOL(mpc8xxx_spi_tx_buf_u16);
>  MPC8XXX_SPI_TX_BUF(u32)
> +EXPORT_SYMBOL(mpc8xxx_spi_tx_buf_u32);

EXPORT_SYMBOL_GPL() please.


>
>  struct mpc8xxx_spi_probe_info *to_of_pinfo(struct fsl_spi_platform_data *pdata)
>  {
>        return container_of(pdata, struct mpc8xxx_spi_probe_info, pdata);
>  }
> +EXPORT_SYMBOL(to_of_pinfo);

Hmmm,. this is not so good because it exports rather generically named
functions out to the global namespace.  These functions should be
renamed to have an mpc8xxx_spi_ prefix before exporting.

Otherwise this patch looks good.

g.

>
>  void mpc8xxx_spi_work(struct work_struct *work)
>  {
> @@ -116,6 +123,7 @@ const char *mpc8xxx_spi_strmode(unsigned int flags)
>        }
>        return "CPU";
>  }
> +EXPORT_SYMBOL(mpc8xxx_spi_strmode);
>
>  int mpc8xxx_spi_probe(struct device *dev, struct resource *mem,
>                        unsigned int irq)
> @@ -168,6 +176,7 @@ int mpc8xxx_spi_probe(struct device *dev, struct resource *mem,
>  err:
>        return ret;
>  }
> +EXPORT_SYMBOL(mpc8xxx_spi_probe);
>
>  int __devexit mpc8xxx_spi_remove(struct device *dev)
>  {
> @@ -188,6 +197,7 @@ int __devexit mpc8xxx_spi_remove(struct device *dev)
>
>        return 0;
>  }
> +EXPORT_SYMBOL(mpc8xxx_spi_remove);
>
>  int __devinit of_mpc8xxx_spi_probe(struct platform_device *ofdev)
>  {
> @@ -234,3 +244,8 @@ err:
>        kfree(pinfo);
>        return ret;
>  }
> +EXPORT_SYMBOL(of_mpc8xxx_spi_probe);
> +
> +MODULE_AUTHOR("Kumar Gala");
> +MODULE_DESCRIPTION("Freescale SPI/eSPI controller driver library");
> +MODULE_LICENSE("GPL");
>



-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

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

* Re: spi_fsl_spi broken when compiled as module by b36ece832512c1a0afa54ff0a56d63492a1caf08
  2011-05-16 18:17     ` Grant Likely
@ 2011-05-16 19:52       ` Lennart Sorensen
  2011-05-16 20:01         ` Grant Likely
  0 siblings, 1 reply; 10+ messages in thread
From: Lennart Sorensen @ 2011-05-16 19:52 UTC (permalink / raw)
  To: Grant Likely
  Cc: Lennart Sorensen, Hu Mingkai-B21284, linux-kernel, Kumar Gala

On Mon, May 16, 2011 at 12:17:13PM -0600, Grant Likely wrote:
> On Thu, May 12, 2011 at 9:11 AM, Lennart Sorensen
> <lsorense@csclub.uwaterloo.ca> wrote:
> > On Thu, May 12, 2011 at 01:33:55AM +0000, Hu Mingkai-B21284 wrote:
> >> Please submit a patch to modify it.
> >
> > OK.  Here it is.
> 
> >
> > --
> > Len Sorensen
> >
> > Add missing exports and module license to allow compiling of spi_fsl_*
> > drivers as modules again.  Originally broken by refactoring of code in
> > b36ece832512c1a0afa54ff0a56d63492a1caf08.
> >
> > diff --git a/drivers/spi/spi_fsl_lib.c b/drivers/spi/spi_fsl_lib.c
> > index ff59f42..d7efaac 100644
> > --- a/drivers/spi/spi_fsl_lib.c
> > +++ b/drivers/spi/spi_fsl_lib.c
> > @@ -48,16 +48,23 @@ u32 mpc8xxx_spi_tx_buf_##type(struct mpc8xxx_spi *mpc8xxx_spi)      \
> >  }
> >
> >  MPC8XXX_SPI_RX_BUF(u8)
> > +EXPORT_SYMBOL(mpc8xxx_spi_rx_buf_u8);
> >  MPC8XXX_SPI_RX_BUF(u16)
> > +EXPORT_SYMBOL(mpc8xxx_spi_rx_buf_u16);
> >  MPC8XXX_SPI_RX_BUF(u32)
> > +EXPORT_SYMBOL(mpc8xxx_spi_rx_buf_u32);
> >  MPC8XXX_SPI_TX_BUF(u8)
> > +EXPORT_SYMBOL(mpc8xxx_spi_tx_buf_u8);
> >  MPC8XXX_SPI_TX_BUF(u16)
> > +EXPORT_SYMBOL(mpc8xxx_spi_tx_buf_u16);
> >  MPC8XXX_SPI_TX_BUF(u32)
> > +EXPORT_SYMBOL(mpc8xxx_spi_tx_buf_u32);
> 
> EXPORT_SYMBOL_GPL() please.

OK.  I never know when that should be used.  Seems to me it should either
be everywhere or nowhere.

> >
> >  struct mpc8xxx_spi_probe_info *to_of_pinfo(struct fsl_spi_platform_data *pdata)
> >  {
> >        return container_of(pdata, struct mpc8xxx_spi_probe_info, pdata);
> >  }
> > +EXPORT_SYMBOL(to_of_pinfo);
> 
> Hmmm,. this is not so good because it exports rather generically named
> functions out to the global namespace.  These functions should be
> renamed to have an mpc8xxx_spi_ prefix before exporting.
> 
> Otherwise this patch looks good.

Hmm, yeah it did look like a crappy function name, but I just wanted to
fix the problem, not try to guess what the author of the code intended.
Prefixing it makes sense.

-- 
Len Sorensen

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

* Re: spi_fsl_spi broken when compiled as module by b36ece832512c1a0afa54ff0a56d63492a1caf08
  2011-05-16 19:52       ` Lennart Sorensen
@ 2011-05-16 20:01         ` Grant Likely
  0 siblings, 0 replies; 10+ messages in thread
From: Grant Likely @ 2011-05-16 20:01 UTC (permalink / raw)
  To: Lennart Sorensen; +Cc: Hu Mingkai-B21284, linux-kernel, Kumar Gala

On Mon, May 16, 2011 at 1:52 PM, Lennart Sorensen
<lsorense@csclub.uwaterloo.ca> wrote:
>> >  struct mpc8xxx_spi_probe_info *to_of_pinfo(struct fsl_spi_platform_data *pdata)
>> >  {
>> >        return container_of(pdata, struct mpc8xxx_spi_probe_info, pdata);
>> >  }
>> > +EXPORT_SYMBOL(to_of_pinfo);
>>
>> Hmmm,. this is not so good because it exports rather generically named
>> functions out to the global namespace.  These functions should be
>> renamed to have an mpc8xxx_spi_ prefix before exporting.
>>
>> Otherwise this patch looks good.
>
> Hmm, yeah it did look like a crappy function name, but I just wanted to
> fix the problem, not try to guess what the author of the code intended.
> Prefixing it makes sense.

Alternately, you can move that function to the common header as a
static inline.  It's just a container_of() wrapper after all, so
moving it would probably be better.

g.

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

end of thread, other threads:[~2011-05-16 20:02 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-11 15:52 spi_fsl_spi broken when compiled as module by b36ece832512c1a0afa54ff0a56d63492a1caf08 Lennart Sorensen
2011-05-11 17:03 ` Lennart Sorensen
2011-05-12  1:33 ` Hu Mingkai-B21284
2011-05-12 15:11   ` Lennart Sorensen
2011-05-16  2:10     ` Hu Mingkai-B21284
2011-05-16  2:17       ` Randy Dunlap
2011-05-16 16:52       ` Lennart Sorensen
2011-05-16 18:17     ` Grant Likely
2011-05-16 19:52       ` Lennart Sorensen
2011-05-16 20:01         ` Grant Likely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®