hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/mmc/host/vub300.c
....@@ -1715,6 +1715,9 @@
17151715 int bytes = 3 & less_cmd;
17161716 int words = less_cmd >> 2;
17171717 u8 *r = vub300->resp.response.command_response;
1718
+
1719
+ if (!resp_len)
1720
+ return;
17181721 if (bytes == 3) {
17191722 cmd->resp[words] = (r[1 + (words << 2)] << 24)
17201723 | (r[2 + (words << 2)] << 16)
....@@ -2049,6 +2052,7 @@
20492052 return;
20502053 kref_get(&vub300->kref);
20512054 if (enable) {
2055
+ set_current_state(TASK_RUNNING);
20522056 mutex_lock(&vub300->irq_mutex);
20532057 if (vub300->irqs_queued) {
20542058 vub300->irqs_queued -= 1;
....@@ -2064,6 +2068,7 @@
20642068 vub300_queue_poll_work(vub300, 0);
20652069 }
20662070 mutex_unlock(&vub300->irq_mutex);
2071
+ set_current_state(TASK_INTERRUPTIBLE);
20672072 } else {
20682073 vub300->irq_enabled = 0;
20692074 }
....@@ -2299,14 +2304,14 @@
22992304 0x0000, 0x0000, &vub300->system_port_status,
23002305 sizeof(vub300->system_port_status), 1000);
23012306 if (retval < 0) {
2302
- goto error4;
2307
+ goto error5;
23032308 } else if (sizeof(vub300->system_port_status) == retval) {
23042309 vub300->card_present =
23052310 (0x0001 & vub300->system_port_status.port_flags) ? 1 : 0;
23062311 vub300->read_only =
23072312 (0x0010 & vub300->system_port_status.port_flags) ? 1 : 0;
23082313 } else {
2309
- goto error4;
2314
+ goto error5;
23102315 }
23112316 usb_set_intfdata(interface, vub300);
23122317 INIT_DELAYED_WORK(&vub300->pollwork, vub300_pollwork_thread);
....@@ -2329,8 +2334,13 @@
23292334 "USB vub300 remote SDIO host controller[%d]"
23302335 "connected with no SD/SDIO card inserted\n",
23312336 interface_to_InterfaceNumber(interface));
2332
- mmc_add_host(mmc);
2337
+ retval = mmc_add_host(mmc);
2338
+ if (retval)
2339
+ goto error6;
2340
+
23332341 return 0;
2342
+error6:
2343
+ del_timer_sync(&vub300->inactivity_timer);
23342344 error5:
23352345 mmc_free_host(mmc);
23362346 /*