summaryrefslogtreecommitdiff
path: root/drivers/firmware
diff options
context:
space:
mode:
authorSaravana Kannan <saravanak@google.com>2020-11-21 05:02:22 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-12-09 21:10:20 +0300
commit01bb86b380a306bd937c96da36f66429f3362137 (patch)
treec2704de4852ab4a3d08db6b027b59ac137a70f3d /drivers/firmware
parentc84b90909e475a2eb4934b4d92fdd10e73e75805 (diff)
downloadlinux-01bb86b380a306bd937c96da36f66429f3362137.tar.xz
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: Rob Herring <robh@kernel.org> Signed-off-by: Saravana Kannan <saravanak@google.com> Link: https://lore.kernel.org/r/20201121020232.908850-8-saravanak@google.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/firmware')
-rw-r--r--drivers/firmware/efi/efi-init.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/firmware/efi/efi-init.c b/drivers/firmware/efi/efi-init.c
index f55a92ff12c0..b148f1459fb3 100644
--- a/drivers/firmware/efi/efi-init.c
+++ b/drivers/firmware/efi/efi-init.c
@@ -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)