Skip to content

Commit 28183db

Browse files
committed
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
2 parents 6942d81 + bb4031b commit 28183db

File tree

4 files changed

+21
-1
lines changed

4 files changed

+21
-1
lines changed

drivers/base/core.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ void fwnode_links_purge(struct fwnode_handle *fwnode)
150150
fwnode_links_purge_consumers(fwnode);
151151
}
152152

153-
static void fw_devlink_purge_absent_suppliers(struct fwnode_handle *fwnode)
153+
void fw_devlink_purge_absent_suppliers(struct fwnode_handle *fwnode)
154154
{
155155
struct fwnode_handle *child;
156156

@@ -164,6 +164,7 @@ static void fw_devlink_purge_absent_suppliers(struct fwnode_handle *fwnode)
164164
fwnode_for_each_available_child_node(fwnode, child)
165165
fw_devlink_purge_absent_suppliers(child);
166166
}
167+
EXPORT_SYMBOL_GPL(fw_devlink_purge_absent_suppliers);
167168

168169
#ifdef CONFIG_SRCU
169170
static DEFINE_MUTEX(device_links_lock);

drivers/clk/clk.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4540,6 +4540,9 @@ int of_clk_add_provider(struct device_node *np,
45404540
struct of_clk_provider *cp;
45414541
int ret;
45424542

4543+
if (!np)
4544+
return 0;
4545+
45434546
cp = kzalloc(sizeof(*cp), GFP_KERNEL);
45444547
if (!cp)
45454548
return -ENOMEM;
@@ -4579,6 +4582,9 @@ int of_clk_add_hw_provider(struct device_node *np,
45794582
struct of_clk_provider *cp;
45804583
int ret;
45814584

4585+
if (!np)
4586+
return 0;
4587+
45824588
cp = kzalloc(sizeof(*cp), GFP_KERNEL);
45834589
if (!cp)
45844590
return -ENOMEM;
@@ -4676,6 +4682,9 @@ void of_clk_del_provider(struct device_node *np)
46764682
{
46774683
struct of_clk_provider *cp;
46784684

4685+
if (!np)
4686+
return;
4687+
46794688
mutex_lock(&of_clk_mutex);
46804689
list_for_each_entry(cp, &of_clk_providers, link) {
46814690
if (cp->node == np) {

drivers/usb/typec/tcpm/tcpm.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5818,6 +5818,15 @@ static int tcpm_fw_get_caps(struct tcpm_port *port,
58185818
if (!fwnode)
58195819
return -EINVAL;
58205820

5821+
/*
5822+
* This fwnode has a "compatible" property, but is never populated as a
5823+
* struct device. Instead we simply parse it to read the properties.
5824+
* This it breaks fw_devlink=on. To maintain backward compatibility
5825+
* with existing DT files, we work around this by deleting any
5826+
* fwnode_links to/from this fwnode.
5827+
*/
5828+
fw_devlink_purge_absent_suppliers(fwnode);
5829+
58215830
/* USB data support is optional */
58225831
ret = fwnode_property_read_string(fwnode, "data-role", &cap_str);
58235832
if (ret == 0) {

include/linux/fwnode.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,5 +187,6 @@ extern u32 fw_devlink_get_flags(void);
187187
extern bool fw_devlink_is_strict(void);
188188
int fwnode_link_add(struct fwnode_handle *con, struct fwnode_handle *sup);
189189
void fwnode_links_purge(struct fwnode_handle *fwnode);
190+
void fw_devlink_purge_absent_suppliers(struct fwnode_handle *fwnode);
190191

191192
#endif

0 commit comments

Comments
 (0)