* RFC: nand and onenand can't coexist
@ 2009-09-20 17:01 Alessandro Rubini
2009-09-20 21:27 ` [PATCH 0/3] Allow Nand and OneNand to coexist Alessandro Rubini
0 siblings, 1 reply; 2+ messages in thread
From: Alessandro Rubini @ 2009-09-20 17:01 UTC (permalink / raw)
To: linux-mtd; +Cc: STEricsson_nomadik_linux
While testing the nomadik-onenand patch as applied by
dwmw2 to the mtd-2.6 git tree, I found that I can't declare
both a nand and onenand platform device in the same file.
The problem arises from the new platform_data for onenand, which
requires me to include <linux/mtd/onenand.h> in the same
file where I include <linux/mtd/nand.h>.
There are two errors reported:
* onenand_state_t and nand_state_t define the same enums,
but with different values
* struct nand_bbt_descr and other material is defined both
in nand.h and bbm.h.
For the latter, including bbm.h from nand.h, removing duplicates,
should work file (I'm going to try it right now).
The former is more of an issue, moreso because the same values
(FL_READY and such) are defined in <mtd/flashchip.h> as well.
Shouldn't they be rather unified?
A quick grep shows that
* nand_state_t is defined by ./include/linux/mtd/nand.h
and never used.
* onenand_state_t is defined by ./include/linux/mtd/onenand.h
and never used
* flstate_t is defined in ./include/linux/mtd/flashchip.h
and used in a few places.
Should I try to unify things in order to allow OneNand and Nand
coexist in the same board source file and remove duplicates?
I'm going to work on the problem anyways, I just don't know
if patches in this direction are acceptable or not.
thanks
/alessandro
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH 0/3] Allow Nand and OneNand to coexist
2009-09-20 17:01 RFC: nand and onenand can't coexist Alessandro Rubini
@ 2009-09-20 21:27 ` Alessandro Rubini
0 siblings, 0 replies; 2+ messages in thread
From: Alessandro Rubini @ 2009-09-20 21:27 UTC (permalink / raw)
To: linux-mtd; +Cc: STEricsson_nomadik_linux, andrea.gallo
These three patches are a possible solution to the problem I had with
Nand and OneNand in the nhk-8815.c source file, as described in my
previous RFC post.
The first patch fixes code duplication between nand.h and
bbm.h. Actually, it replicates a fix I made to U-Boot some months ago
for the same reason. Without it, we have the same structure (with the
same name) declared in two different headers.
The second patch unifies nand_state_t and onenand_state_t into
flstate_t. Most states were exactly the same, and no user of those
types is affected by having more states than needed. This avoid
redefinition errors for FL_READY and similar values. I chose to
keep flstate_t (the NOR one), as it's name is the most generic.
The third, trivial patch, enables OneNand for Nomadik, including both
<linux/mtd/nand.h> and <linux/mtd/onenand.h>, since it's now possible
to do it.
Alessandro Rubini (3):
mtd: use bbm.h in nand.h
mtd: unify status enum from three headers
ARM Nomadik: use new OneNand name and pdata
arch/arm/mach-nomadik/board-nhk8815.c | 11 ++--
include/linux/mtd/bbm.h | 35 ++++++------
include/linux/mtd/flashchip.h | 7 +++
include/linux/mtd/nand.h | 93 +-------------------------------
include/linux/mtd/onenand.h | 19 +------
5 files changed, 36 insertions(+), 129 deletions(-)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-09-20 21:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-20 17:01 RFC: nand and onenand can't coexist Alessandro Rubini
2009-09-20 21:27 ` [PATCH 0/3] Allow Nand and OneNand to coexist Alessandro Rubini
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).