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
07ca9d40
Commit
07ca9d40
authored
Nov 13, 2004
by
Russell King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[MTD] sa1100: consolidate mtd and partition destructors.
parent
c26c68e3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
29 deletions
+25
-29
drivers/mtd/maps/sa1100-flash.c
drivers/mtd/maps/sa1100-flash.c
+25
-29
No files found.
drivers/mtd/maps/sa1100-flash.c
View file @
07ca9d40
...
@@ -1002,6 +1002,28 @@ static int sa1100_probe_subdev(struct sa_subdev_info *subdev)
...
@@ -1002,6 +1002,28 @@ static int sa1100_probe_subdev(struct sa_subdev_info *subdev)
return
ret
;
return
ret
;
}
}
static
struct
mtd_partition
*
parsed_parts
;
static
void
sa1100_destroy
(
struct
mtd_info
*
mtd
)
{
int
i
;
if
(
mtd
)
{
del_mtd_partitions
(
mtd
);
#ifdef CONFIG_MTD_CONCAT
if
(
mtd
!=
sa
[
i
].
mtd
)
mtd_concat_destroy
(
mtd
);
#endif
}
if
(
parsed_parts
)
kfree
(
parsed_parts
);
for
(
i
=
NR_SUBMTD
;
i
>=
0
;
i
--
)
sa1100_destroy_subdev
(
&
sa
[
i
]);
}
static
int
__init
sa1100_setup_mtd
(
struct
sa_subdev_info
*
sa
,
int
nr
,
struct
mtd_info
**
rmtd
)
static
int
__init
sa1100_setup_mtd
(
struct
sa_subdev_info
*
sa
,
int
nr
,
struct
mtd_info
**
rmtd
)
{
{
struct
mtd_info
*
cdev
[
nr
];
struct
mtd_info
*
cdev
[
nr
];
...
@@ -1056,30 +1078,12 @@ static int __init sa1100_setup_mtd(struct sa_subdev_info *sa, int nr, struct mtd
...
@@ -1056,30 +1078,12 @@ static int __init sa1100_setup_mtd(struct sa_subdev_info *sa, int nr, struct mtd
/*
/*
* If we failed, clean up.
* If we failed, clean up.
*/
*/
if
(
ret
)
{
if
(
ret
)
do
{
sa1100_destroy
(
NULL
);
sa1100_destroy_subdev
(
&
sa
[
i
]);
}
while
(
i
--
>
0
);
}
return
ret
;
return
ret
;
}
}
static
void
__exit
sa1100_destroy_mtd
(
struct
sa_subdev_info
*
sa
,
struct
mtd_info
*
mtd
)
{
int
i
;
del_mtd_partitions
(
mtd
);
#ifdef CONFIG_MTD_CONCAT
if
(
mtd
!=
sa
[
0
].
mtd
)
mtd_concat_destroy
(
mtd
);
#endif
for
(
i
=
NR_SUBMTD
;
i
>=
0
;
i
--
)
sa1100_destroy_subdev
(
&
sa
[
i
]);
}
static
int
__init
sa1100_locate_flash
(
void
)
static
int
__init
sa1100_locate_flash
(
void
)
{
{
int
i
,
nr
=
-
ENODEV
;
int
i
,
nr
=
-
ENODEV
;
...
@@ -1256,7 +1260,6 @@ static int __init sa1100_locate_flash(void)
...
@@ -1256,7 +1260,6 @@ static int __init sa1100_locate_flash(void)
return
nr
;
return
nr
;
}
}
static
struct
mtd_partition
*
parsed_parts
;
const
char
*
part_probes
[]
=
{
"cmdlinepart"
,
"RedBoot"
,
NULL
};
const
char
*
part_probes
[]
=
{
"cmdlinepart"
,
"RedBoot"
,
NULL
};
static
void
__init
sa1100_locate_partitions
(
struct
mtd_info
*
mtd
)
static
void
__init
sa1100_locate_partitions
(
struct
mtd_info
*
mtd
)
...
@@ -1297,12 +1300,6 @@ static void __init sa1100_locate_partitions(struct mtd_info *mtd)
...
@@ -1297,12 +1300,6 @@ static void __init sa1100_locate_partitions(struct mtd_info *mtd)
/* Always succeeds. */
/* Always succeeds. */
}
}
static
void
__exit
sa1100_destroy_partitions
(
void
)
{
if
(
parsed_parts
)
kfree
(
parsed_parts
);
}
static
struct
mtd_info
*
mymtd
;
static
struct
mtd_info
*
mymtd
;
static
int
__init
sa1100_mtd_probe
(
struct
device
*
dev
)
static
int
__init
sa1100_mtd_probe
(
struct
device
*
dev
)
...
@@ -1323,8 +1320,7 @@ static int __init sa1100_mtd_probe(struct device *dev)
...
@@ -1323,8 +1320,7 @@ static int __init sa1100_mtd_probe(struct device *dev)
static
int
__exit
sa1100_mtd_remove
(
struct
device
*
dev
)
static
int
__exit
sa1100_mtd_remove
(
struct
device
*
dev
)
{
{
sa1100_destroy_mtd
(
info
,
mymtd
);
sa1100_destroy
(
mymtd
);
sa1100_destroy_partitions
();
return
0
;
return
0
;
}
}
...
...
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