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
7b9734db
Commit
7b9734db
authored
Oct 21, 2018
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'spi/topic/of' into spi-next
parents
4b51c747
5f143af7
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
3 deletions
+21
-3
drivers/spi/spi.c
drivers/spi/spi.c
+5
-2
include/linux/spi/spi.h
include/linux/spi/spi.h
+16
-1
No files found.
drivers/spi/spi.c
View file @
7b9734db
...
...
@@ -3398,20 +3398,23 @@ EXPORT_SYMBOL_GPL(spi_write_then_read);
/*-------------------------------------------------------------------------*/
#if IS_ENABLED(CONFIG_OF
_DYNAMIC
)
#if IS_ENABLED(CONFIG_OF)
static
int
__spi_of_device_match
(
struct
device
*
dev
,
void
*
data
)
{
return
dev
->
of_node
==
data
;
}
/* must call put_device() when done with returned spi_device device */
st
atic
st
ruct
spi_device
*
of_find_spi_device_by_node
(
struct
device_node
*
node
)
struct
spi_device
*
of_find_spi_device_by_node
(
struct
device_node
*
node
)
{
struct
device
*
dev
=
bus_find_device
(
&
spi_bus_type
,
NULL
,
node
,
__spi_of_device_match
);
return
dev
?
to_spi_device
(
dev
)
:
NULL
;
}
EXPORT_SYMBOL_GPL
(
of_find_spi_device_by_node
);
#endif
/* IS_ENABLED(CONFIG_OF) */
#if IS_ENABLED(CONFIG_OF_DYNAMIC)
static
int
__spi_of_controller_match
(
struct
device
*
dev
,
const
void
*
data
)
{
return
dev
->
of_node
==
data
;
...
...
include/linux/spi/spi.h
View file @
7b9734db
...
...
@@ -1272,7 +1272,6 @@ spi_register_board_info(struct spi_board_info const *info, unsigned n)
{
return
0
;
}
#endif
/* If you're hotplugging an adapter with devices (parport, usb, etc)
* use spi_new_device() to describe each device. You can also call
* spi_unregister_device() to start making that device vanish, but
...
...
@@ -1304,6 +1303,22 @@ spi_transfer_is_last(struct spi_controller *ctlr, struct spi_transfer *xfer)
return
list_is_last
(
&
xfer
->
transfer_list
,
&
ctlr
->
cur_msg
->
transfers
);
}
/* OF support code */
#if IS_ENABLED(CONFIG_OF)
/* must call put_device() when done with returned spi_device device */
extern
struct
spi_device
*
of_find_spi_device_by_node
(
struct
device_node
*
node
);
#else
static
inline
struct
spi_device
*
of_find_spi_device_by_node
(
struct
device_node
*
node
)
{
return
NULL
;
}
#endif
/* IS_ENABLED(CONFIG_OF) */
/* Compatibility layer */
#define spi_master spi_controller
...
...
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