Commit 01bb86b3 authored by Saravana Kannan's avatar Saravana Kannan Committed by Greg Kroah-Hartman
Browse files

driver core: Add fwnode_init()



There are multiple locations in the kernel where a struct fwnode_handle
is initialized. Add fwnode_init() so that we have one way of
initializing a fwnode_handle.

Acked-by: default avatarRob Herring <robh@kernel.org>
Signed-off-by: default avatarSaravana Kannan <saravanak@google.com>
Link: https://lore.kernel.org/r/20201121020232.908850-8-saravanak@google.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c84b9090
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -76,7 +76,7 @@ static bool acpi_nondev_subnode_extract(const union acpi_object *desc,
		return false;

	dn->name = link->package.elements[0].string.pointer;
	dn->fwnode.ops = &acpi_data_fwnode_ops;
	fwnode_init(&dn->fwnode, &acpi_data_fwnode_ops);
	dn->parent = parent;
	INIT_LIST_HEAD(&dn->data.properties);
	INIT_LIST_HEAD(&dn->data.subnodes);
+1 −1
Original line number Diff line number Diff line
@@ -1589,7 +1589,7 @@ void acpi_init_device_object(struct acpi_device *device, acpi_handle handle,
	device->device_type = type;
	device->handle = handle;
	device->parent = acpi_bus_get_parent(handle);
	device->fwnode.ops = &acpi_device_fwnode_ops;
	fwnode_init(&device->fwnode, &acpi_device_fwnode_ops);
	acpi_set_device_status(device, sta);
	acpi_device_get_busid(device);
	acpi_set_pnp_ids(handle, &device->pnp, type);
+1 −1
Original line number Diff line number Diff line
@@ -653,7 +653,7 @@ swnode_register(const struct software_node *node, struct swnode *parent,
	swnode->parent = parent;
	swnode->allocated = allocated;
	swnode->kobj.kset = swnode_kset;
	swnode->fwnode.ops = &software_node_ops;
	fwnode_init(&swnode->fwnode, &software_node_ops);

	ida_init(&swnode->child_ids);
	INIT_LIST_HEAD(&swnode->entry);
+4 −4
Original line number Diff line number Diff line
@@ -359,9 +359,7 @@ static const struct fwnode_operations efifb_fwnode_ops = {
	.add_links = efifb_add_links,
};

static struct fwnode_handle efifb_fwnode = {
	.ops = &efifb_fwnode_ops,
};
static struct fwnode_handle efifb_fwnode;

static int __init register_gop_device(void)
{
@@ -375,8 +373,10 @@ static int __init register_gop_device(void)
	if (!pd)
		return -ENOMEM;

	if (IS_ENABLED(CONFIG_PCI))
	if (IS_ENABLED(CONFIG_PCI)) {
		fwnode_init(&efifb_fwnode, &efifb_fwnode_ops);
		pd->dev.fwnode = &efifb_fwnode;
	}

	err = platform_device_add_data(pd, &screen_info, sizeof(screen_info));
	if (err)
+6 −0
Original line number Diff line number Diff line
@@ -170,6 +170,12 @@ struct fwnode_operations {
	} while (false)
#define get_dev_from_fwnode(fwnode)	get_device((fwnode)->dev)

static inline void fwnode_init(struct fwnode_handle *fwnode,
			       const struct fwnode_operations *ops)
{
	fwnode->ops = ops;
}

extern u32 fw_devlink_get_flags(void);

#endif
Loading