File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -1483,18 +1483,26 @@ static int __init sc16is7xx_init(void)
1483
1483
ret = i2c_add_driver (& sc16is7xx_i2c_uart_driver );
1484
1484
if (ret < 0 ) {
1485
1485
pr_err ("failed to init sc16is7xx i2c --> %d\n" , ret );
1486
- return ret ;
1486
+ goto err_i2c ;
1487
1487
}
1488
1488
#endif
1489
1489
1490
1490
#ifdef CONFIG_SERIAL_SC16IS7XX_SPI
1491
1491
ret = spi_register_driver (& sc16is7xx_spi_uart_driver );
1492
1492
if (ret < 0 ) {
1493
1493
pr_err ("failed to init sc16is7xx spi --> %d\n" , ret );
1494
- return ret ;
1494
+ goto err_spi ;
1495
1495
}
1496
1496
#endif
1497
1497
return ret ;
1498
+
1499
+ err_spi :
1500
+ #ifdef CONFIG_SERIAL_SC16IS7XX_I2C
1501
+ i2c_del_driver (& sc16is7xx_i2c_uart_driver );
1502
+ #endif
1503
+ err_i2c :
1504
+ uart_unregister_driver (& sc16is7xx_uart );
1505
+ return ret ;
1498
1506
}
1499
1507
module_init (sc16is7xx_init );
1500
1508
You can’t perform that action at this time.
0 commit comments