Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
c176d0ca
Commit
c176d0ca
authored
Oct 16, 2008
by
Dmitry Baryshkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[MTD] sharpsl-nand: cleanup partitions support
Signed-off-by:
Dmitry Baryshkov
<
dbaryshkov@gmail.com
>
parent
a4e4f29c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
4 deletions
+18
-4
drivers/mtd/nand/sharpsl.c
drivers/mtd/nand/sharpsl.c
+18
-4
No files found.
drivers/mtd/nand/sharpsl.c
View file @
c176d0ca
...
...
@@ -2,6 +2,7 @@
* drivers/mtd/nand/sharpsl.c
*
* Copyright (C) 2004 Richard Purdie
* Copyright (C) 2008 Dmitry Baryshkov
*
* Based on Sharp's NAND driver sharp_sl.c
*
...
...
@@ -52,12 +53,12 @@ struct sharpsl_nand {
#define FLCLE (1 << 1)
#define FLCE0 (1 << 0)
#ifdef CONFIG_MTD_PARTITIONS
/*
* Define partitions for flash device
*/
#define DEFAULT_NUM_PARTITIONS 3
static
int
nr_partitions
;
static
struct
mtd_partition
sharpsl_nand_default_partition_info
[]
=
{
{
.
name
=
"System Area"
,
...
...
@@ -75,6 +76,7 @@ static struct mtd_partition sharpsl_nand_default_partition_info[] = {
.
size
=
MTDPART_SIZ_FULL
,
},
};
#endif
/*
* hardware specific access to control-lines
...
...
@@ -151,7 +153,7 @@ static int sharpsl_nand_calculate_ecc(struct mtd_info *mtd, const u_char * dat,
}
#ifdef CONFIG_MTD_PARTITIONS
const
char
*
part_probes
[]
=
{
"cmdlinepart"
,
NULL
};
static
const
char
*
part_probes
[]
=
{
"cmdlinepart"
,
NULL
};
#endif
/*
...
...
@@ -160,7 +162,10 @@ const char *part_probes[] = { "cmdlinepart", NULL };
static
int
__devinit
sharpsl_nand_probe
(
struct
platform_device
*
pdev
)
{
struct
nand_chip
*
this
;
#ifdef CONFIG_MTD_PARTITIONS
struct
mtd_partition
*
sharpsl_partition_info
;
int
nr_partitions
;
#endif
struct
resource
*
r
;
int
err
=
0
;
struct
sharpsl_nand
*
sharpsl
;
...
...
@@ -229,10 +234,11 @@ static int __devinit sharpsl_nand_probe(struct platform_device *pdev)
/* Register the partitions */
sharpsl
->
mtd
.
name
=
"sharpsl-nand"
;
#ifdef CONFIG_MTD_PARTITIONS
nr_partitions
=
parse_mtd_partitions
(
&
sharpsl
->
mtd
,
part_probes
,
&
sharpsl_partition_info
,
0
);
if
(
nr_partitions
<=
0
)
{
nr_partitions
=
DEFAULT_NUM_PARTITIONS
;
nr_partitions
=
ARRAY_SIZE
(
sharpsl_nand_default_partition_info
)
;
sharpsl_partition_info
=
sharpsl_nand_default_partition_info
;
if
(
machine_is_poodle
())
{
sharpsl_partition_info
[
1
].
size
=
22
*
1024
*
1024
;
...
...
@@ -249,11 +255,19 @@ static int __devinit sharpsl_nand_probe(struct platform_device *pdev)
}
}
add_mtd_partitions
(
&
sharpsl
->
mtd
,
sharpsl_partition_info
,
nr_partitions
);
err
=
add_mtd_partitions
(
&
sharpsl
->
mtd
,
sharpsl_partition_info
,
nr_partitions
);
#else
err
=
add_mtd_device
(
&
sharpsl
->
mtd
);
#endif
if
(
err
)
goto
err_add
;
/* Return happy */
return
0
;
err_add:
nand_release
(
&
sharpsl
->
mtd
);
err_scan:
platform_set_drvdata
(
pdev
,
NULL
);
iounmap
(
sharpsl
->
io
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment