Commit 28183dbf authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'driver-core-5.13-rc2' of...

Merge tag 'driver-core-5.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core

Pull driver core fixes from Greg KH:
 "Here are two driver fixes for driver core changes that happened in
  5.13-rc1.

  The clk driver fix resolves a many-reported issue with booting some
  devices, and the USB typec fix resolves the reported problem of USB
  systems on some embedded boards.

  Both of these have been in linux-next this week with no reported
  issues"

* tag 'driver-core-5.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
  clk: Skip clk provider registration when np is NULL
  usb: typec: tcpm: Don't block probing of consumers of "connector" nodes
parents 6942d81a bb4031b8
...@@ -150,7 +150,7 @@ void fwnode_links_purge(struct fwnode_handle *fwnode) ...@@ -150,7 +150,7 @@ void fwnode_links_purge(struct fwnode_handle *fwnode)
fwnode_links_purge_consumers(fwnode); fwnode_links_purge_consumers(fwnode);
} }
static void fw_devlink_purge_absent_suppliers(struct fwnode_handle *fwnode) void fw_devlink_purge_absent_suppliers(struct fwnode_handle *fwnode)
{ {
struct fwnode_handle *child; struct fwnode_handle *child;
...@@ -164,6 +164,7 @@ static void fw_devlink_purge_absent_suppliers(struct fwnode_handle *fwnode) ...@@ -164,6 +164,7 @@ static void fw_devlink_purge_absent_suppliers(struct fwnode_handle *fwnode)
fwnode_for_each_available_child_node(fwnode, child) fwnode_for_each_available_child_node(fwnode, child)
fw_devlink_purge_absent_suppliers(child); fw_devlink_purge_absent_suppliers(child);
} }
EXPORT_SYMBOL_GPL(fw_devlink_purge_absent_suppliers);
#ifdef CONFIG_SRCU #ifdef CONFIG_SRCU
static DEFINE_MUTEX(device_links_lock); static DEFINE_MUTEX(device_links_lock);
......
...@@ -4540,6 +4540,9 @@ int of_clk_add_provider(struct device_node *np, ...@@ -4540,6 +4540,9 @@ int of_clk_add_provider(struct device_node *np,
struct of_clk_provider *cp; struct of_clk_provider *cp;
int ret; int ret;
if (!np)
return 0;
cp = kzalloc(sizeof(*cp), GFP_KERNEL); cp = kzalloc(sizeof(*cp), GFP_KERNEL);
if (!cp) if (!cp)
return -ENOMEM; return -ENOMEM;
...@@ -4579,6 +4582,9 @@ int of_clk_add_hw_provider(struct device_node *np, ...@@ -4579,6 +4582,9 @@ int of_clk_add_hw_provider(struct device_node *np,
struct of_clk_provider *cp; struct of_clk_provider *cp;
int ret; int ret;
if (!np)
return 0;
cp = kzalloc(sizeof(*cp), GFP_KERNEL); cp = kzalloc(sizeof(*cp), GFP_KERNEL);
if (!cp) if (!cp)
return -ENOMEM; return -ENOMEM;
...@@ -4676,6 +4682,9 @@ void of_clk_del_provider(struct device_node *np) ...@@ -4676,6 +4682,9 @@ void of_clk_del_provider(struct device_node *np)
{ {
struct of_clk_provider *cp; struct of_clk_provider *cp;
if (!np)
return;
mutex_lock(&of_clk_mutex); mutex_lock(&of_clk_mutex);
list_for_each_entry(cp, &of_clk_providers, link) { list_for_each_entry(cp, &of_clk_providers, link) {
if (cp->node == np) { if (cp->node == np) {
......
...@@ -5818,6 +5818,15 @@ static int tcpm_fw_get_caps(struct tcpm_port *port, ...@@ -5818,6 +5818,15 @@ static int tcpm_fw_get_caps(struct tcpm_port *port,
if (!fwnode) if (!fwnode)
return -EINVAL; return -EINVAL;
/*
* This fwnode has a "compatible" property, but is never populated as a
* struct device. Instead we simply parse it to read the properties.
* This it breaks fw_devlink=on. To maintain backward compatibility
* with existing DT files, we work around this by deleting any
* fwnode_links to/from this fwnode.
*/
fw_devlink_purge_absent_suppliers(fwnode);
/* USB data support is optional */ /* USB data support is optional */
ret = fwnode_property_read_string(fwnode, "data-role", &cap_str); ret = fwnode_property_read_string(fwnode, "data-role", &cap_str);
if (ret == 0) { if (ret == 0) {
......
...@@ -187,5 +187,6 @@ extern u32 fw_devlink_get_flags(void); ...@@ -187,5 +187,6 @@ extern u32 fw_devlink_get_flags(void);
extern bool fw_devlink_is_strict(void); extern bool fw_devlink_is_strict(void);
int fwnode_link_add(struct fwnode_handle *con, struct fwnode_handle *sup); int fwnode_link_add(struct fwnode_handle *con, struct fwnode_handle *sup);
void fwnode_links_purge(struct fwnode_handle *fwnode); void fwnode_links_purge(struct fwnode_handle *fwnode);
void fw_devlink_purge_absent_suppliers(struct fwnode_handle *fwnode);
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment