Commit 5886b130 authored by Shang XiaoJing's avatar Shang XiaoJing Committed by Helge Deller

fbdev: via: Fix error in via_core_init()

via_core_init() won't exit the driver when pci_register_driver() failed.
Exit the viafb-i2c and the viafb-gpio in failed path to prevent error.

VIA Graphics Integration Chipset framebuffer 2.4 initializing
Error: Driver 'viafb-i2c' is already registered, aborting...
Error: Driver 'viafb-gpio' is already registered, aborting...

Fixes: 7582eb9b ("viafb: Turn GPIO and i2c into proper platform devices")
Signed-off-by: default avatarShang XiaoJing <shangxiaojing@huawei.com>
Signed-off-by: default avatarHelge Deller <deller@gmx.de>
parent ed359a46
......@@ -733,7 +733,14 @@ static int __init via_core_init(void)
return ret;
viafb_i2c_init();
viafb_gpio_init();
return pci_register_driver(&via_driver);
ret = pci_register_driver(&via_driver);
if (ret) {
viafb_gpio_exit();
viafb_i2c_exit();
return ret;
}
return 0;
}
static void __exit via_core_exit(void)
......
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