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
nexedi
linux
Commits
0d2ef7d7
Commit
0d2ef7d7
authored
Oct 29, 2005
by
Russell King
Committed by
Russell King
Oct 29, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ARM] Add support for init/exit methods in sa1100 MTD map driver
Signed-off-by:
Russell King
<
rmk+kernel@arm.linux.org.uk
>
parent
57725f0a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
3 deletions
+15
-3
drivers/mtd/maps/sa1100-flash.c
drivers/mtd/maps/sa1100-flash.c
+15
-3
No files found.
drivers/mtd/maps/sa1100-flash.c
View file @
0d2ef7d7
...
@@ -223,7 +223,7 @@ static int sa1100_probe_subdev(struct sa_subdev_info *subdev, struct resource *r
...
@@ -223,7 +223,7 @@ static int sa1100_probe_subdev(struct sa_subdev_info *subdev, struct resource *r
return
ret
;
return
ret
;
}
}
static
void
sa1100_destroy
(
struct
sa_info
*
info
)
static
void
sa1100_destroy
(
struct
sa_info
*
info
,
struct
flash_platform_data
*
plat
)
{
{
int
i
;
int
i
;
...
@@ -242,6 +242,9 @@ static void sa1100_destroy(struct sa_info *info)
...
@@ -242,6 +242,9 @@ static void sa1100_destroy(struct sa_info *info)
for
(
i
=
info
->
num_subdev
-
1
;
i
>=
0
;
i
--
)
for
(
i
=
info
->
num_subdev
-
1
;
i
>=
0
;
i
--
)
sa1100_destroy_subdev
(
&
info
->
subdev
[
i
]);
sa1100_destroy_subdev
(
&
info
->
subdev
[
i
]);
kfree
(
info
);
kfree
(
info
);
if
(
plat
->
exit
)
plat
->
exit
();
}
}
static
struct
sa_info
*
__init
static
struct
sa_info
*
__init
...
@@ -275,6 +278,12 @@ sa1100_setup_mtd(struct platform_device *pdev, struct flash_platform_data *plat)
...
@@ -275,6 +278,12 @@ sa1100_setup_mtd(struct platform_device *pdev, struct flash_platform_data *plat)
memset
(
info
,
0
,
size
);
memset
(
info
,
0
,
size
);
if
(
plat
->
init
)
{
ret
=
plat
->
init
();
if
(
ret
)
goto
err
;
}
/*
/*
* Claim and then map the memory regions.
* Claim and then map the memory regions.
*/
*/
...
@@ -336,7 +345,7 @@ sa1100_setup_mtd(struct platform_device *pdev, struct flash_platform_data *plat)
...
@@ -336,7 +345,7 @@ sa1100_setup_mtd(struct platform_device *pdev, struct flash_platform_data *plat)
return
info
;
return
info
;
err:
err:
sa1100_destroy
(
info
);
sa1100_destroy
(
info
,
plat
);
out:
out:
return
ERR_PTR
(
ret
);
return
ERR_PTR
(
ret
);
}
}
...
@@ -397,8 +406,11 @@ static int __init sa1100_mtd_probe(struct device *dev)
...
@@ -397,8 +406,11 @@ 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
)
{
{
struct
sa_info
*
info
=
dev_get_drvdata
(
dev
);
struct
sa_info
*
info
=
dev_get_drvdata
(
dev
);
struct
flash_platform_data
*
plat
=
dev
->
platform_data
;
dev_set_drvdata
(
dev
,
NULL
);
dev_set_drvdata
(
dev
,
NULL
);
sa1100_destroy
(
info
);
sa1100_destroy
(
info
,
plat
);
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