Commit 767e693b authored by Thomas Zimmermann's avatar Thomas Zimmermann

fbdev/rivafb: Reorder backlight and framebuffer init/cleanup

The driver's backlight code requires the framebuffer to be
registered. Therefore reorder the init and cleanup calls for
both data structures.
Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Cc: Antonino Daplas <adaplas@gmail.com>
Reviewed-by: default avatarJavier Martinez Canillas <javierm@redhat.com>
Reviewed-by: default avatarSam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230613110953.24176-24-tzimmermann@suse.de
parent e7df4a9b
...@@ -2031,9 +2031,6 @@ static int rivafb_probe(struct pci_dev *pd, const struct pci_device_id *ent) ...@@ -2031,9 +2031,6 @@ static int rivafb_probe(struct pci_dev *pd, const struct pci_device_id *ent)
pci_set_drvdata(pd, info); pci_set_drvdata(pd, info);
if (backlight)
riva_bl_init(info->par);
ret = register_framebuffer(info); ret = register_framebuffer(info);
if (ret < 0) { if (ret < 0) {
printk(KERN_ERR PFX printk(KERN_ERR PFX
...@@ -2041,6 +2038,9 @@ static int rivafb_probe(struct pci_dev *pd, const struct pci_device_id *ent) ...@@ -2041,6 +2038,9 @@ static int rivafb_probe(struct pci_dev *pd, const struct pci_device_id *ent)
goto err_iounmap_screen_base; goto err_iounmap_screen_base;
} }
if (backlight)
riva_bl_init(info->par);
printk(KERN_INFO PFX printk(KERN_INFO PFX
"PCI nVidia %s framebuffer ver %s (%dMB @ 0x%lX)\n", "PCI nVidia %s framebuffer ver %s (%dMB @ 0x%lX)\n",
info->fix.id, info->fix.id,
...@@ -2084,9 +2084,9 @@ static void rivafb_remove(struct pci_dev *pd) ...@@ -2084,9 +2084,9 @@ static void rivafb_remove(struct pci_dev *pd)
kfree(par->EDID); kfree(par->EDID);
#endif #endif
riva_bl_exit(info);
unregister_framebuffer(info); unregister_framebuffer(info);
riva_bl_exit(info);
arch_phys_wc_del(par->wc_cookie); arch_phys_wc_del(par->wc_cookie);
iounmap(par->ctrl_base); iounmap(par->ctrl_base);
iounmap(info->screen_base); iounmap(info->screen_base);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment