.. | .. |
---|
1332 | 1332 | #ifdef RTSX_USB_USE_LEDS_CLASS |
---|
1333 | 1333 | int err; |
---|
1334 | 1334 | #endif |
---|
| 1335 | + int ret; |
---|
1335 | 1336 | |
---|
1336 | 1337 | ucr = usb_get_intfdata(to_usb_interface(pdev->dev.parent)); |
---|
1337 | 1338 | if (!ucr) |
---|
.. | .. |
---|
1368 | 1369 | INIT_WORK(&host->led_work, rtsx_usb_update_led); |
---|
1369 | 1370 | |
---|
1370 | 1371 | #endif |
---|
1371 | | - mmc_add_host(mmc); |
---|
| 1372 | + ret = mmc_add_host(mmc); |
---|
| 1373 | + if (ret) { |
---|
| 1374 | +#ifdef RTSX_USB_USE_LEDS_CLASS |
---|
| 1375 | + led_classdev_unregister(&host->led); |
---|
| 1376 | +#endif |
---|
| 1377 | + mmc_free_host(mmc); |
---|
| 1378 | + pm_runtime_disable(&pdev->dev); |
---|
| 1379 | + return ret; |
---|
| 1380 | + } |
---|
1372 | 1381 | |
---|
1373 | 1382 | return 0; |
---|
1374 | 1383 | } |
---|