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);
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);
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);
.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)
{
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)
} 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
#if defined(CONFIG_OF_KOBJ)
kobject_init(&node->kobj, &of_node_ktype);
#endif
- node->fwnode.ops = &of_fwnode_ops;
+ fwnode_init(&node->fwnode, &of_fwnode_ops);
}
#if defined(CONFIG_OF_KOBJ)
fwid->type = type;
fwid->name = n;
fwid->pa = pa;
- fwid->fwnode.ops = &irqchip_fwnode_ops;
+ fwnode_init(&fwid->fwnode, &irqchip_fwnode_ops);
return &fwid->fwnode;
}
EXPORT_SYMBOL_GPL(__irq_domain_alloc_fwnode);