summaryrefslogtreecommitdiffstats
path: root/drivers/video/fbdev/riva
diff options
context:
space:
mode:
authorThomas Zimmermann <tzimmermann@suse.de>2023-06-13 13:06:58 +0200
committerThomas Zimmermann <tzimmermann@suse.de>2023-06-27 09:58:50 +0200
commit767e693b488afe9c764704893c45f6ff7dca330a (patch)
tree13068b60477bd357b7c6a45f793a01b77fe4a9ff /drivers/video/fbdev/riva
parentfbdev/radeonfb: Use hardware device as backlight parent (diff)
downloadlinux-767e693b488afe9c764704893c45f6ff7dca330a.tar.xz
linux-767e693b488afe9c764704893c45f6ff7dca330a.zip
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: Thomas Zimmermann <tzimmermann@suse.de> Cc: Antonino Daplas <adaplas@gmail.com> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Reviewed-by: Sam Ravnborg <sam@ravnborg.org> Link: https://patchwork.freedesktop.org/patch/msgid/20230613110953.24176-24-tzimmermann@suse.de
Diffstat (limited to 'drivers/video/fbdev/riva')
-rw-r--r--drivers/video/fbdev/riva/fbdev.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/video/fbdev/riva/fbdev.c b/drivers/video/fbdev/riva/fbdev.c
index 41edc6e79460..e328b2d39e2b 100644
--- a/drivers/video/fbdev/riva/fbdev.c
+++ b/drivers/video/fbdev/riva/fbdev.c
@@ -2031,9 +2031,6 @@ static int rivafb_probe(struct pci_dev *pd, const struct pci_device_id *ent)
pci_set_drvdata(pd, info);
- if (backlight)
- riva_bl_init(info->par);
-
ret = register_framebuffer(info);
if (ret < 0) {
printk(KERN_ERR PFX
@@ -2041,6 +2038,9 @@ static int rivafb_probe(struct pci_dev *pd, const struct pci_device_id *ent)
goto err_iounmap_screen_base;
}
+ if (backlight)
+ riva_bl_init(info->par);
+
printk(KERN_INFO PFX
"PCI nVidia %s framebuffer ver %s (%dMB @ 0x%lX)\n",
info->fix.id,
@@ -2084,9 +2084,9 @@ static void rivafb_remove(struct pci_dev *pd)
kfree(par->EDID);
#endif
+ riva_bl_exit(info);
unregister_framebuffer(info);
- riva_bl_exit(info);
arch_phys_wc_del(par->wc_cookie);
iounmap(par->ctrl_base);
iounmap(info->screen_base);