remarkable-linux/include
Grant Likely 102eb97564 spi: make spi_board_info.modalias a char array
Currently, 'modalias' in the spi_device structure is a 'const char *'.
The spi_new_device() function fills in the modalias value from a passed in
spi_board_info data block.  Since it is a pointer copy, the new spi_device
remains dependent on the spi_board_info structure after the new spi_device
is registered (no other fields in spi_device directly depend on the
spi_board_info structure; all of the other data is copied).

This causes a problem when dynamically propulating the list of attached
SPI devices.  For example, in arch/powerpc, the list of SPI devices can be
populated from data in the device tree.  With the current code, the device
tree adapter must kmalloc() a new spi_board_info structure for each new
SPI device it finds in the device tree, and there is no simple mechanism
in place for keeping track of these allocations.

This patch changes modalias from a 'const char *' to a fixed char array.
By copying the modalias string instead of referencing it, the dependency
on the spi_board_info structure is eliminated and an outside caller does
not need to maintain a separate spi_board_info allocation for each device.

If searched through the code to the best of my ability for any references
to modalias which may be affected by this change and haven't found
anything.  It has been tested with the lite5200b platform in arch/powerpc.

[dbrownell@users.sourceforge.net: cope with linux-next changes: KOBJ_NAME_LEN obliterated, etc]
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-24 10:47:30 -07:00
..
acpi Merge branch 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6 2008-07-16 17:25:46 -07:00
asm-alpha flag parameters: paccept 2008-07-24 10:47:27 -07:00
asm-arm pm: remove remaining obsolete definitions from pm.h 2008-07-24 10:47:22 -07:00
asm-avr32 PAGE_ALIGN(): correctly handle 64-bit values on 32-bit architectures 2008-07-24 10:47:21 -07:00
asm-blackfin PAGE_ALIGN(): correctly handle 64-bit values on 32-bit architectures 2008-07-24 10:47:21 -07:00
asm-cris cris: remove unused global_flush_tlb 2008-07-24 10:47:24 -07:00
asm-frv PAGE_ALIGN(): correctly handle 64-bit values on 32-bit architectures 2008-07-24 10:47:21 -07:00
asm-generic Merge branch 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6 2008-07-16 17:25:46 -07:00
asm-h8300 remove include/asm-h8300/keyboard.h 2008-07-24 10:47:22 -07:00
asm-ia64 PAGE_ALIGN(): correctly handle 64-bit values on 32-bit architectures 2008-07-24 10:47:21 -07:00
asm-m32r PAGE_ALIGN(): correctly handle 64-bit values on 32-bit architectures 2008-07-24 10:47:21 -07:00
asm-m68k PAGE_ALIGN(): correctly handle 64-bit values on 32-bit architectures 2008-07-24 10:47:21 -07:00
asm-m68knommu PAGE_ALIGN(): correctly handle 64-bit values on 32-bit architectures 2008-07-24 10:47:21 -07:00
asm-mips flag parameters: socket and socketpair 2008-07-24 10:47:27 -07:00
asm-mn10300 mn10300: move sg_dma_{address,len}() to asm/scatterlist.h 2008-07-24 10:47:24 -07:00
asm-parisc flag parameters: paccept 2008-07-24 10:47:27 -07:00
asm-powerpc PAGE_ALIGN(): correctly handle 64-bit values on 32-bit architectures 2008-07-24 10:47:21 -07:00
asm-s390 PAGE_ALIGN(): correctly handle 64-bit values on 32-bit architectures 2008-07-24 10:47:21 -07:00
asm-sh PAGE_ALIGN(): correctly handle 64-bit values on 32-bit architectures 2008-07-24 10:47:21 -07:00
asm-sparc PAGE_ALIGN(): correctly handle 64-bit values on 32-bit architectures 2008-07-24 10:47:21 -07:00
asm-sparc64 sparc: join the remaining header files 2008-07-17 21:55:51 -07:00
asm-um UML: make several more things static 2008-07-24 10:47:24 -07:00
asm-v850 remove the v850 port 2008-07-24 10:47:24 -07:00
asm-x86 flag parameters add-on: remove epoll_create size param 2008-07-24 10:47:29 -07:00
asm-xtensa PAGE_ALIGN(): correctly handle 64-bit values on 32-bit architectures 2008-07-24 10:47:21 -07:00
crypto crypto: hash - Move ahash functions into crypto/hash.h 2008-07-10 20:35:18 +08:00
drm drm/radeon: fixup issue with radeon and PAT support. 2008-07-15 15:48:05 +10:00
keys
linux spi: make spi_board_info.modalias a char array 2008-07-24 10:47:30 -07:00
math-emu
media V4L/DVB (8395): saa7134: Fix Kbuild dependency of ir-kbd-i2c 2008-07-20 07:29:03 -03:00
mtd
net ipv6: icmp6_dst_gc return change 2008-07-22 14:35:50 -07:00
pcmcia pcmcia: (re)move {pcmcia,pccard}_get_status 2008-06-24 15:33:44 +02:00
rdma RDMA/addr: Keep pointer to netdevice in struct rdma_dev_addr 2008-07-14 23:48:53 -07:00
rxrpc
scsi driver core: remove KOBJ_NAME_LEN define 2008-07-21 21:54:52 -07:00
sound ALSA: Release v1.0.17 2008-07-14 09:54:43 +02:00
video
xen xen: implement Xen-specific spinlocks 2008-07-16 11:15:53 +02:00
Kbuild drm: reorganise drm tree to be more future proof. 2008-07-14 10:45:01 +10:00