mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-08 12:58:12 -04:00
Merge "FROMGIT: BACKPORT: driver core: Add device links from fwnode only for the primary device"
This commit is contained in:
commit
e58b281c91
1 changed files with 5 additions and 2 deletions
|
|
@ -2378,6 +2378,7 @@ int device_add(struct device *dev)
|
|||
struct class_interface *class_intf;
|
||||
int error = -EINVAL, fw_ret;
|
||||
struct kobject *glue_dir = NULL;
|
||||
bool is_fwnode_dev = false;
|
||||
|
||||
dev = get_device(dev);
|
||||
if (!dev)
|
||||
|
|
@ -2475,8 +2476,10 @@ int device_add(struct device *dev)
|
|||
|
||||
kobject_uevent(&dev->kobj, KOBJ_ADD);
|
||||
|
||||
if (dev->fwnode && !dev->fwnode->dev)
|
||||
if (dev->fwnode && !dev->fwnode->dev) {
|
||||
dev->fwnode->dev = dev;
|
||||
is_fwnode_dev = true;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check if any of the other devices (consumers) have been waiting for
|
||||
|
|
@ -2492,7 +2495,7 @@ int device_add(struct device *dev)
|
|||
*/
|
||||
device_link_add_missing_supplier_links();
|
||||
|
||||
if (fwnode_has_op(dev->fwnode, add_links)) {
|
||||
if (is_fwnode_dev && fwnode_has_op(dev->fwnode, add_links)) {
|
||||
fw_ret = fwnode_call_int_op(dev->fwnode, add_links, dev);
|
||||
if (fw_ret == -ENODEV)
|
||||
device_link_wait_for_mandatory_supplier(dev);
|
||||
|
|
|
|||
Loading…
Reference in a new issue