Skip to content

Commit

Permalink
fbdev/nvidiafb: Reorder backlight and framebuffer init/cleanup
Browse files Browse the repository at this point in the history
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-19-tzimmermann@suse.de
  • Loading branch information
Thomas Zimmermann authored and neomax7 committed Nov 7, 2023
1 parent 824066e commit abf2e60
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/video/fbdev/nvidia/nvidia.c
Original file line number Diff line number Diff line change
Expand Up @@ -1400,14 +1400,14 @@ static int nvidiafb_probe(struct pci_dev *pd, const struct pci_device_id *ent)

pci_set_drvdata(pd, info);

if (backlight)
nvidia_bl_init(par);

if (register_framebuffer(info) < 0) {
printk(KERN_ERR PFX "error registering nVidia framebuffer\n");
goto err_out_iounmap_fb;
}

if (backlight)
nvidia_bl_init(par);

printk(KERN_INFO PFX
"PCI nVidia %s framebuffer (%dMB @ 0x%lX)\n",
info->fix.id,
Expand Down Expand Up @@ -1439,9 +1439,9 @@ static void nvidiafb_remove(struct pci_dev *pd)

NVTRACE_ENTER();

nvidia_bl_exit(par);
unregister_framebuffer(info);

nvidia_bl_exit(par);
arch_phys_wc_del(par->wc_cookie);
iounmap(info->screen_base);
fb_destroy_modedb(info->monspecs.modedb);
Expand Down

0 comments on commit abf2e60

Please sign in to comment.