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
a75481ab
Commit
a75481ab
authored
Mar 11, 2016
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'spi/topic/dma' into spi-next
parents
df9633a7
df88e91b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
drivers/spi/spi.c
drivers/spi/spi.c
+3
-3
No files found.
drivers/spi/spi.c
View file @
a75481ab
...
@@ -702,6 +702,7 @@ static int spi_map_buf(struct spi_master *master, struct device *dev,
...
@@ -702,6 +702,7 @@ static int spi_map_buf(struct spi_master *master, struct device *dev,
enum
dma_data_direction
dir
)
enum
dma_data_direction
dir
)
{
{
const
bool
vmalloced_buf
=
is_vmalloc_addr
(
buf
);
const
bool
vmalloced_buf
=
is_vmalloc_addr
(
buf
);
unsigned
int
max_seg_size
=
dma_get_max_seg_size
(
dev
);
int
desc_len
;
int
desc_len
;
int
sgs
;
int
sgs
;
struct
page
*
vm_page
;
struct
page
*
vm_page
;
...
@@ -710,10 +711,10 @@ static int spi_map_buf(struct spi_master *master, struct device *dev,
...
@@ -710,10 +711,10 @@ static int spi_map_buf(struct spi_master *master, struct device *dev,
int
i
,
ret
;
int
i
,
ret
;
if
(
vmalloced_buf
)
{
if
(
vmalloced_buf
)
{
desc_len
=
PAGE_SIZE
;
desc_len
=
min_t
(
int
,
max_seg_size
,
PAGE_SIZE
)
;
sgs
=
DIV_ROUND_UP
(
len
+
offset_in_page
(
buf
),
desc_len
);
sgs
=
DIV_ROUND_UP
(
len
+
offset_in_page
(
buf
),
desc_len
);
}
else
{
}
else
{
desc_len
=
m
aster
->
max_dma_len
;
desc_len
=
m
in_t
(
int
,
max_seg_size
,
master
->
max_dma_len
)
;
sgs
=
DIV_ROUND_UP
(
len
,
desc_len
);
sgs
=
DIV_ROUND_UP
(
len
,
desc_len
);
}
}
...
@@ -739,7 +740,6 @@ static int spi_map_buf(struct spi_master *master, struct device *dev,
...
@@ -739,7 +740,6 @@ static int spi_map_buf(struct spi_master *master, struct device *dev,
sg_set_buf
(
&
sgt
->
sgl
[
i
],
sg_buf
,
min
);
sg_set_buf
(
&
sgt
->
sgl
[
i
],
sg_buf
,
min
);
}
}
buf
+=
min
;
buf
+=
min
;
len
-=
min
;
len
-=
min
;
}
}
...
...
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