[PATCH 0/1] Renaming 'struct flash_platform_data' into 'struct spi_flash_platform_data' in include/linux/spi/flash.h
Alexis RODET
alexis.rodet at bvs-tech.com
Mon Jan 24 06:37:22 EST 2011
Hello Grant,
On 21/01/2011 20:28, Grant Likely wrote :
> Hi Alexis,
>
> Patch doesn't apply. Looks like it's whitespace damaged (tabs
> converted to spaces). Did you try to cut & paste it? git send-email
> is a more reliable way to post patches.
Yes I did, sorry I hadn't installed git-send-email.
OK I'll do this way.
Get my patch in next e-mail.
> Also, for a change as far-reaching as this you should do it in two
> stages; rename the structure, but leave a #define to the old name so
> that conflicts aren't generated in linux-next. Then remove the
> #define after the change makes it into Linus' tree.
And I keep changing all source code that use this structure, don't I ?
>> Here is the command line used for doing this:
>> find . \( -name .git -prune -false -o -path ./include/linux/spi/flash.h -o \( -name \*.c -execdir grep -q '#include <linux/spi/flash.h>' \{\} \; \) \) -execdir sed -i -e 's/struct flash_platform_data/struct spi_flash_platform_data/' \{\} \+ -execdir git add \{\} \+ -print
> This looks to me like it will miss any files that include
> linux/spi/flash.h indirectly (ie, if they include a header that
> includes linux/spi/flash.h). A simple 'git grep flash_platform_data'
> could very well be sufficient for finding the call sites.
Yes, I knew this might be a problem.
I checked this and this doesn't happen:
There is no ".h" file that include linux/spi/flash.h so their can't be indirect use.
I checked also any ".h" file that have 'struct flash_platform_data' and I found:
./arch/arm/mach-ixp2000/include/mach/platform.h
./arch/arm/mach-sa1100/generic.h
./arch/arm/include/asm/mach/flash.h
that are all related in source code to the last one.
After my patch, the only files that have struct flash_platform_data without #include <asm/mach/flash.h> are the 3 .h files above and ./drivers/mtd/onenand/generic.c inside a comment:
29: * with the name "onenand" used to take struct flash_platform_data.
> That being said, is it really worth making this change? What is your
> motivation? There isn't actually anything spi-specific in the
> flash_platform_data structure.
The main problem is there are 2 different struct flash_platform_data
1 in include/linux/spi/flash.h for SPI flash devices that work with SPI API (also through MTD).
1 in arm/include/asm/mach/flash.h for other mtd flash devices (NOR, NAND...) that work with MTD API.
The one in SPI is more recent and less used in source code, so this one should not have got the same name and the work is easier.
My motivation is I have a machine with both SPI and NOR/NAND that need both structures and ".h" files conflicts.
Alexis
-------------- next part --------------
A non-text attachment was scrubbed...
Name: alexis_rodet.vcf
Type: text/x-vcard
Size: 315 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-mtd/attachments/20110124/8cf4994d/attachment.vcf>
More information about the linux-mtd
mailing list