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
42af2f5c
Commit
42af2f5c
authored
Feb 19, 2017
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'spi/topic/core' into spi-next
parents
e0afd0fa
8324147f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
11 deletions
+16
-11
drivers/spi/spi-fsl-spi.c
drivers/spi/spi-fsl-spi.c
+9
-8
drivers/spi/spi.c
drivers/spi/spi.c
+7
-3
No files found.
drivers/spi/spi-fsl-spi.c
View file @
42af2f5c
...
...
@@ -267,10 +267,9 @@ static int fsl_spi_setup_transfer(struct spi_device *spi,
if
((
mpc8xxx_spi
->
spibrg
/
hz
)
>
64
)
{
cs
->
hw_mode
|=
SPMODE_DIV16
;
pm
=
(
mpc8xxx_spi
->
spibrg
-
1
)
/
(
hz
*
64
)
+
1
;
WARN_ONCE
(
pm
>
16
,
"%s: Requested speed is too low: %d Hz. "
"Will use %d Hz instead.
\n
"
,
dev_name
(
&
spi
->
dev
),
hz
,
mpc8xxx_spi
->
spibrg
/
1024
);
WARN_ONCE
(
pm
>
16
,
"%s: Requested speed is too low: %d Hz. Will use %d Hz instead.
\n
"
,
dev_name
(
&
spi
->
dev
),
hz
,
mpc8xxx_spi
->
spibrg
/
1024
);
if
(
pm
>
16
)
pm
=
16
;
}
else
{
...
...
@@ -727,12 +726,13 @@ static int of_fsl_spi_get_chipselects(struct device *dev)
return
0
;
}
pinfo
->
gpios
=
kmalloc
(
ngpios
*
sizeof
(
*
pinfo
->
gpios
),
GFP_KERNEL
);
pinfo
->
gpios
=
kmalloc_array
(
ngpios
,
sizeof
(
*
pinfo
->
gpios
),
GFP_KERNEL
);
if
(
!
pinfo
->
gpios
)
return
-
ENOMEM
;
memset
(
pinfo
->
gpios
,
-
1
,
ngpios
*
sizeof
(
*
pinfo
->
gpios
));
pinfo
->
alow_flags
=
k
zalloc
(
ngpios
*
sizeof
(
*
pinfo
->
alow_flags
),
pinfo
->
alow_flags
=
k
calloc
(
ngpios
,
sizeof
(
*
pinfo
->
alow_flags
),
GFP_KERNEL
);
if
(
!
pinfo
->
alow_flags
)
{
ret
=
-
ENOMEM
;
...
...
@@ -762,8 +762,9 @@ static int of_fsl_spi_get_chipselects(struct device *dev)
ret
=
gpio_direction_output
(
pinfo
->
gpios
[
i
],
pinfo
->
alow_flags
[
i
]);
if
(
ret
)
{
dev_err
(
dev
,
"can't set output direction for gpio "
"#%d: %d
\n
"
,
i
,
ret
);
dev_err
(
dev
,
"can't set output direction for gpio #%d: %d
\n
"
,
i
,
ret
);
goto
err_loop
;
}
}
...
...
drivers/spi/spi.c
View file @
42af2f5c
...
...
@@ -621,8 +621,10 @@ void spi_unregister_device(struct spi_device *spi)
if
(
!
spi
)
return
;
if
(
spi
->
dev
.
of_node
)
if
(
spi
->
dev
.
of_node
)
{
of_node_clear_flag
(
spi
->
dev
.
of_node
,
OF_POPULATED
);
of_node_put
(
spi
->
dev
.
of_node
);
}
if
(
ACPI_COMPANION
(
&
spi
->
dev
))
acpi_device_clear_enumerated
(
ACPI_COMPANION
(
&
spi
->
dev
));
device_unregister
(
&
spi
->
dev
);
...
...
@@ -672,7 +674,7 @@ int spi_register_board_info(struct spi_board_info const *info, unsigned n)
if
(
!
n
)
return
-
EINVAL
;
bi
=
k
zalloc
(
n
*
sizeof
(
*
bi
),
GFP_KERNEL
);
bi
=
k
calloc
(
n
,
sizeof
(
*
bi
),
GFP_KERNEL
);
if
(
!
bi
)
return
-
ENOMEM
;
...
...
@@ -1603,11 +1605,13 @@ of_register_spi_device(struct spi_master *master, struct device_node *nc)
if
(
rc
)
{
dev_err
(
&
master
->
dev
,
"spi_device register error %s
\n
"
,
nc
->
full_name
);
goto
err_out
;
goto
err_o
f_node_p
ut
;
}
return
spi
;
err_of_node_put:
of_node_put
(
nc
);
err_out:
spi_dev_put
(
spi
);
return
ERR_PTR
(
rc
);
...
...
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