public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* changing module from single to multi-file build
@ 2009-10-13  8:24 Ben Dooks
  2009-10-13 18:39 ` Sam Ravnborg
  0 siblings, 1 reply; 2+ messages in thread
From: Ben Dooks @ 2009-10-13  8:24 UTC (permalink / raw)
  To: sam, linux-kernel; +Cc: spi-devel-general

I have a driver, drivers/spi/spi_s3c24xx.c in this case that I have
written an FIQ handler for which requires some assembly code. My attempts
at trying to change it so that I can build a single module with both the
C and ASM code linked together have not yet been a success.

The original makefile bit from drivers/spi/Makefile was:

 obj-$(CONFIG_SPI_S3C24XX)              += spi_s3c24xx.o

This allows it to work as a kernel builtin:

 obj-$(CONFIG_SPI_S3C24XX)              += spi_s3c24xx.o
 obj-$(CONFIG_SPI_S3C24XX_FIQ)          += spi_s3c24xx_fiq.o

I tried adding the following to the file, but this does not make
the FIQ code, I assume as there is still drivers/spi/spi_s3c24xx.c.

 obj-spi_s3c24xx-y                      := spi_s3c24xx.o
 obj-spi_s3c24xx-$(CONFIG_SPI_S3C24XX_FIQ) += spi_s3c24xx_fiq.o

Should I rename drivers/spi/spi_s3c24xx.c to something else to avoid
changing the module name, change the module name to avoid renaming the .c
to say  spi_s3c24xx_hw (we have a gpio implementation, but that could easily
be removed in favour of gpiolib). Or is there something else that could
be done?

Note, I was initially against renaming the module, but with module autoload
working so well it seems easier to rename the module than try renaming the
.c file.

-- 
Ben (ben@fluff.org, http://www.fluff.org/)

  'a smiley only costs 4 bytes'

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

* Re: changing module from single to multi-file build
  2009-10-13  8:24 changing module from single to multi-file build Ben Dooks
@ 2009-10-13 18:39 ` Sam Ravnborg
  0 siblings, 0 replies; 2+ messages in thread
From: Sam Ravnborg @ 2009-10-13 18:39 UTC (permalink / raw)
  To: Ben Dooks; +Cc: linux-kernel, spi-devel-general

On Tue, Oct 13, 2009 at 09:24:27AM +0100, Ben Dooks wrote:
> I have a driver, drivers/spi/spi_s3c24xx.c in this case that I have
> written an FIQ handler for which requires some assembly code. My attempts
> at trying to change it so that I can build a single module with both the
> C and ASM code linked together have not yet been a success.
> 
> The original makefile bit from drivers/spi/Makefile was:
> 
>  obj-$(CONFIG_SPI_S3C24XX)              += spi_s3c24xx.o
> 
> This allows it to work as a kernel builtin:
> 
>  obj-$(CONFIG_SPI_S3C24XX)              += spi_s3c24xx.o
>  obj-$(CONFIG_SPI_S3C24XX_FIQ)          += spi_s3c24xx_fiq.o
> 
> I tried adding the following to the file, but this does not make
> the FIQ code, I assume as there is still drivers/spi/spi_s3c24xx.c.
> 
>  obj-spi_s3c24xx-y                      := spi_s3c24xx.o
>  obj-spi_s3c24xx-$(CONFIG_SPI_S3C24XX_FIQ) += spi_s3c24xx_fiq.o

A multi-file module cannot have a .c file with a name
equal to the modulename.
So going from a single-file module to a multi-file
module rwquire you to rename the .c file if you want
to keep the old module name.

	Sam

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

end of thread, other threads:[~2009-10-13 18:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-13  8:24 changing module from single to multi-file build Ben Dooks
2009-10-13 18:39 ` Sam Ravnborg

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