hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/mmc/host/rtsx_usb_sdmmc.c
....@@ -1332,6 +1332,7 @@
13321332 #ifdef RTSX_USB_USE_LEDS_CLASS
13331333 int err;
13341334 #endif
1335
+ int ret;
13351336
13361337 ucr = usb_get_intfdata(to_usb_interface(pdev->dev.parent));
13371338 if (!ucr)
....@@ -1368,7 +1369,15 @@
13681369 INIT_WORK(&host->led_work, rtsx_usb_update_led);
13691370
13701371 #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
+ }
13721381
13731382 return 0;
13741383 }