aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/usb
diff options
context:
space:
mode:
authorHeikki Krogerus <heikki.krogerus@linux.intel.com>2019-08-29 17:22:34 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-09-03 16:46:17 +0200
commita31f01777bc54a0a9d57628956d05f8d454d3418 (patch)
treeeabb787a1fc1f028328e58e87a25ed68df1cd246 /include/linux/usb
parentdevice connection: Add fwnode_connection_find_match() (diff)
downloadlinux-dev-a31f01777bc54a0a9d57628956d05f8d454d3418.tar.xz
linux-dev-a31f01777bc54a0a9d57628956d05f8d454d3418.zip
usb: roles: Add fwnode_usb_role_switch_get() function
The fwnode_usb_role_switch_get() function is exactly the same as usb_role_switch_get(), except that it takes struct fwnode_handle as parameter instead of struct device. Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com> Tested-by: Biju Das <biju.das@bp.renesas.com> Link: https://lore.kernel.org/r/1567070558-29417-8-git-send-email-chunfeng.yun@mediatek.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/usb')
-rw-r--r--include/linux/usb/role.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/usb/role.h b/include/linux/usb/role.h
index da2b9641b877..2d77f97df72d 100644
--- a/include/linux/usb/role.h
+++ b/include/linux/usb/role.h
@@ -47,6 +47,7 @@ struct usb_role_switch_desc {
int usb_role_switch_set_role(struct usb_role_switch *sw, enum usb_role role);
enum usb_role usb_role_switch_get_role(struct usb_role_switch *sw);
struct usb_role_switch *usb_role_switch_get(struct device *dev);
+struct usb_role_switch *fwnode_usb_role_switch_get(struct fwnode_handle *node);
void usb_role_switch_put(struct usb_role_switch *sw);
struct usb_role_switch *
@@ -70,6 +71,12 @@ static inline struct usb_role_switch *usb_role_switch_get(struct device *dev)
return ERR_PTR(-ENODEV);
}
+static inline struct usb_role_switch *
+fwnode_usb_role_switch_get(struct fwnode_handle *node)
+{
+ return ERR_PTR(-ENODEV);
+}
+
static inline void usb_role_switch_put(struct usb_role_switch *sw) { }
static inline struct usb_role_switch *