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
8757091b
Commit
8757091b
authored
Jun 18, 2015
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'spi/fix/core' into spi-linus
parents
0f57d867
4b786458
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
17 deletions
+28
-17
drivers/spi/spi.c
drivers/spi/spi.c
+28
-17
No files found.
drivers/spi/spi.c
View file @
8757091b
...
...
@@ -571,7 +571,7 @@ static int __spi_map_msg(struct spi_master *master, struct spi_message *msg)
return
0
;
}
static
int
spi_unmap_msg
(
struct
spi_master
*
master
,
struct
spi_message
*
msg
)
static
int
__
spi_unmap_msg
(
struct
spi_master
*
master
,
struct
spi_message
*
msg
)
{
struct
spi_transfer
*
xfer
;
struct
device
*
tx_dev
,
*
rx_dev
;
...
...
@@ -583,15 +583,6 @@ static int spi_unmap_msg(struct spi_master *master, struct spi_message *msg)
rx_dev
=
master
->
dma_rx
->
device
->
dev
;
list_for_each_entry
(
xfer
,
&
msg
->
transfers
,
transfer_list
)
{
/*
* Restore the original value of tx_buf or rx_buf if they are
* NULL.
*/
if
(
xfer
->
tx_buf
==
master
->
dummy_tx
)
xfer
->
tx_buf
=
NULL
;
if
(
xfer
->
rx_buf
==
master
->
dummy_rx
)
xfer
->
rx_buf
=
NULL
;
if
(
!
master
->
can_dma
(
master
,
msg
->
spi
,
xfer
))
continue
;
...
...
@@ -608,13 +599,32 @@ static inline int __spi_map_msg(struct spi_master *master,
return
0
;
}
static
inline
int
spi_unmap_msg
(
struct
spi_master
*
master
,
struct
spi_message
*
msg
)
static
inline
int
__
spi_unmap_msg
(
struct
spi_master
*
master
,
struct
spi_message
*
msg
)
{
return
0
;
}
#endif
/* !CONFIG_HAS_DMA */
static
inline
int
spi_unmap_msg
(
struct
spi_master
*
master
,
struct
spi_message
*
msg
)
{
struct
spi_transfer
*
xfer
;
list_for_each_entry
(
xfer
,
&
msg
->
transfers
,
transfer_list
)
{
/*
* Restore the original value of tx_buf or rx_buf if they are
* NULL.
*/
if
(
xfer
->
tx_buf
==
master
->
dummy_tx
)
xfer
->
tx_buf
=
NULL
;
if
(
xfer
->
rx_buf
==
master
->
dummy_rx
)
xfer
->
rx_buf
=
NULL
;
}
return
__spi_unmap_msg
(
master
,
msg
);
}
static
int
spi_map_msg
(
struct
spi_master
*
master
,
struct
spi_message
*
msg
)
{
struct
spi_transfer
*
xfer
;
...
...
@@ -988,9 +998,6 @@ void spi_finalize_current_message(struct spi_master *master)
spin_lock_irqsave
(
&
master
->
queue_lock
,
flags
);
mesg
=
master
->
cur_msg
;
master
->
cur_msg
=
NULL
;
queue_kthread_work
(
&
master
->
kworker
,
&
master
->
pump_messages
);
spin_unlock_irqrestore
(
&
master
->
queue_lock
,
flags
);
spi_unmap_msg
(
master
,
mesg
);
...
...
@@ -1003,9 +1010,13 @@ void spi_finalize_current_message(struct spi_master *master)
}
}
trace_spi_message_done
(
mesg
);
spin_lock_irqsave
(
&
master
->
queue_lock
,
flags
);
master
->
cur_msg
=
NULL
;
master
->
cur_msg_prepared
=
false
;
queue_kthread_work
(
&
master
->
kworker
,
&
master
->
pump_messages
);
spin_unlock_irqrestore
(
&
master
->
queue_lock
,
flags
);
trace_spi_message_done
(
mesg
);
mesg
->
state
=
NULL
;
if
(
mesg
->
complete
)
...
...
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