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
aae730df
Commit
aae730df
authored
Apr 10, 2012
by
Grant Likely
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'spi' of
git://gitorious.org/linus-tree/linus-tree
into spi/next
parents
00341028
1a77b127
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
37 deletions
+9
-37
drivers/spi/spi-omap2-mcspi.c
drivers/spi/spi-omap2-mcspi.c
+9
-37
No files found.
drivers/spi/spi-omap2-mcspi.c
View file @
aae730df
...
...
@@ -791,7 +791,7 @@ static int omap2_mcspi_setup(struct spi_device *spi)
mcspi_dma
=
&
mcspi
->
dma_channels
[
spi
->
chip_select
];
if
(
!
cs
)
{
cs
=
kzalloc
(
sizeof
*
cs
,
GFP_KERNEL
);
cs
=
devm_kzalloc
(
&
spi
->
dev
,
sizeof
*
cs
,
GFP_KERNEL
);
if
(
!
cs
)
return
-
ENOMEM
;
cs
->
base
=
mcspi
->
base
+
spi
->
chip_select
*
0x14
;
...
...
@@ -833,7 +833,6 @@ static void omap2_mcspi_cleanup(struct spi_device *spi)
cs
=
spi
->
controller_state
;
list_del
(
&
cs
->
node
);
kfree
(
spi
->
controller_state
);
}
if
(
spi
->
chip_select
<
spi
->
master
->
num_chipselect
)
{
...
...
@@ -1102,7 +1101,7 @@ static const struct of_device_id omap_mcspi_of_match[] = {
};
MODULE_DEVICE_TABLE
(
of
,
omap_mcspi_of_match
);
static
int
__init
omap2_mcspi_probe
(
struct
platform_device
*
pdev
)
static
int
__
dev
init
omap2_mcspi_probe
(
struct
platform_device
*
pdev
)
{
struct
spi_master
*
master
;
struct
omap2_mcspi_platform_config
*
pdata
;
...
...
@@ -1166,17 +1165,12 @@ static int __init omap2_mcspi_probe(struct platform_device *pdev)
r
->
start
+=
regs_offset
;
r
->
end
+=
regs_offset
;
mcspi
->
phys
=
r
->
start
;
if
(
!
request_mem_region
(
r
->
start
,
resource_size
(
r
),
dev_name
(
&
pdev
->
dev
)))
{
status
=
-
EBUSY
;
goto
free_master
;
}
mcspi
->
base
=
ioremap
(
r
->
start
,
resource_size
(
r
)
);
mcspi
->
base
=
devm_request_and_ioremap
(
&
pdev
->
dev
,
r
);
if
(
!
mcspi
->
base
)
{
dev_dbg
(
&
pdev
->
dev
,
"can't ioremap MCSPI
\n
"
);
status
=
-
ENOMEM
;
goto
release_region
;
goto
free_master
;
}
mcspi
->
dev
=
&
pdev
->
dev
;
...
...
@@ -1191,7 +1185,7 @@ static int __init omap2_mcspi_probe(struct platform_device *pdev)
GFP_KERNEL
);
if
(
mcspi
->
dma_channels
==
NULL
)
goto
unmap_io
;
goto
free_master
;
for
(
i
=
0
;
i
<
master
->
num_chipselect
;
i
++
)
{
char
dma_ch_name
[
14
];
...
...
@@ -1241,23 +1235,17 @@ static int __init omap2_mcspi_probe(struct platform_device *pdev)
pm_runtime_disable
(
&
pdev
->
dev
);
dma_chnl_free:
kfree
(
mcspi
->
dma_channels
);
unmap_io:
iounmap
(
mcspi
->
base
);
release_region:
release_mem_region
(
r
->
start
,
resource_size
(
r
));
free_master:
kfree
(
master
);
platform_set_drvdata
(
pdev
,
NULL
);
return
status
;
}
static
int
__exit
omap2_mcspi_remove
(
struct
platform_device
*
pdev
)
static
int
__
dev
exit
omap2_mcspi_remove
(
struct
platform_device
*
pdev
)
{
struct
spi_master
*
master
;
struct
omap2_mcspi
*
mcspi
;
struct
omap2_mcspi_dma
*
dma_channels
;
struct
resource
*
r
;
void
__iomem
*
base
;
master
=
dev_get_drvdata
(
&
pdev
->
dev
);
mcspi
=
spi_master_get_devdata
(
master
);
...
...
@@ -1265,12 +1253,8 @@ static int __exit omap2_mcspi_remove(struct platform_device *pdev)
omap2_mcspi_disable_clocks
(
mcspi
);
pm_runtime_disable
(
&
pdev
->
dev
);
r
=
platform_get_resource
(
pdev
,
IORESOURCE_MEM
,
0
);
release_mem_region
(
r
->
start
,
resource_size
(
r
));
base
=
mcspi
->
base
;
spi_unregister_master
(
master
);
iounmap
(
base
);
kfree
(
dma_channels
);
destroy_workqueue
(
mcspi
->
wq
);
platform_set_drvdata
(
pdev
,
NULL
);
...
...
@@ -1327,21 +1311,9 @@ static struct platform_driver omap2_mcspi_driver = {
.
pm
=
&
omap2_mcspi_pm_ops
,
.
of_match_table
=
omap_mcspi_of_match
,
},
.
remove
=
__exit_p
(
omap2_mcspi_remove
),
.
probe
=
omap2_mcspi_probe
,
.
remove
=
__devexit_p
(
omap2_mcspi_remove
),
};
static
int
__init
omap2_mcspi_init
(
void
)
{
return
platform_driver_probe
(
&
omap2_mcspi_driver
,
omap2_mcspi_probe
);
}
subsys_initcall
(
omap2_mcspi_init
);
static
void
__exit
omap2_mcspi_exit
(
void
)
{
platform_driver_unregister
(
&
omap2_mcspi_driver
);
}
module_exit
(
omap2_mcspi_exit
);
module_platform_driver
(
omap2_mcspi_driver
);
MODULE_LICENSE
(
"GPL"
);
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