Skip to content

Commit e82a840

Browse files
Saravana Kannangregkh
authored andcommitted
efi: Update implementation of add_links() to create fwnode links
The semantics of add_links() has changed from creating device link between devices to creating fwnode links between fwnodes. So, update the implementation of add_links() to match the new semantics. Signed-off-by: Saravana Kannan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 8a06d1e commit e82a840

File tree

1 file changed

+1
-20
lines changed

1 file changed

+1
-20
lines changed

drivers/firmware/efi/efi-init.c

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,6 @@ static int efifb_add_links(struct fwnode_handle *fwnode,
320320
struct device *dev)
321321
{
322322
struct device_node *sup_np;
323-
struct device *sup_dev;
324323

325324
sup_np = find_pci_overlap_node();
326325

@@ -331,27 +330,9 @@ static int efifb_add_links(struct fwnode_handle *fwnode,
331330
if (!sup_np)
332331
return 0;
333332

334-
sup_dev = get_dev_from_fwnode(&sup_np->fwnode);
333+
fwnode_link_add(fwnode, of_fwnode_handle(sup_np));
335334
of_node_put(sup_np);
336335

337-
/*
338-
* Return -ENODEV if the PCI graphics controller device hasn't been
339-
* registered yet. This ensures that efifb isn't allowed to probe
340-
* and this function is retried again when new devices are
341-
* registered.
342-
*/
343-
if (!sup_dev)
344-
return -ENODEV;
345-
346-
/*
347-
* If this fails, retrying this function at a later point won't
348-
* change anything. So, don't return an error after this.
349-
*/
350-
if (!device_link_add(dev, sup_dev, fw_devlink_get_flags()))
351-
dev_warn(dev, "device_link_add() failed\n");
352-
353-
put_device(sup_dev);
354-
355336
return 0;
356337
}
357338

0 commit comments

Comments
 (0)