Skip to content

Commit e755554

Browse files
Thomas Zimmermannlag-linaro
authored andcommitted
hid: hid-picolcd: Fix initialization order
For drivers that support backlight, LCD and fbdev devices, fbdev has to be initialized last. See documentation for struct fbinfo.bl_dev. Signed-off-by: Thomas Zimmermann <[email protected]> Cc: Bruno Prémont <[email protected]> Reviewed-by: Javier Martinez Canillas <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Lee Jones <[email protected]>
1 parent 3306821 commit e755554

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

drivers/hid/hid-picolcd_core.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -474,11 +474,6 @@ static int picolcd_probe_lcd(struct hid_device *hdev, struct picolcd_data *data)
474474
if (error)
475475
goto err;
476476

477-
/* Set up the framebuffer device */
478-
error = picolcd_init_framebuffer(data);
479-
if (error)
480-
goto err;
481-
482477
/* Setup lcd class device */
483478
error = picolcd_init_lcd(data, picolcd_out_report(REPORT_CONTRAST, hdev));
484479
if (error)
@@ -489,6 +484,11 @@ static int picolcd_probe_lcd(struct hid_device *hdev, struct picolcd_data *data)
489484
if (error)
490485
goto err;
491486

487+
/* Set up the framebuffer device */
488+
error = picolcd_init_framebuffer(data);
489+
if (error)
490+
goto err;
491+
492492
/* Setup the LED class devices */
493493
error = picolcd_init_leds(data, picolcd_out_report(REPORT_LED_STATE, hdev));
494494
if (error)
@@ -502,9 +502,9 @@ static int picolcd_probe_lcd(struct hid_device *hdev, struct picolcd_data *data)
502502
return 0;
503503
err:
504504
picolcd_exit_leds(data);
505+
picolcd_exit_framebuffer(data);
505506
picolcd_exit_backlight(data);
506507
picolcd_exit_lcd(data);
507-
picolcd_exit_framebuffer(data);
508508
picolcd_exit_cir(data);
509509
picolcd_exit_keys(data);
510510
return error;
@@ -623,9 +623,9 @@ static void picolcd_remove(struct hid_device *hdev)
623623
/* Cleanup LED */
624624
picolcd_exit_leds(data);
625625
/* Clean up the framebuffer */
626+
picolcd_exit_framebuffer(data);
626627
picolcd_exit_backlight(data);
627628
picolcd_exit_lcd(data);
628-
picolcd_exit_framebuffer(data);
629629
/* Cleanup input */
630630
picolcd_exit_cir(data);
631631
picolcd_exit_keys(data);

0 commit comments

Comments
 (0)