| .. | .. |
|---|
| 318 | 318 | txn->dest = c_struct; |
|---|
| 319 | 319 | |
|---|
| 320 | 320 | mutex_lock(&qmi->txn_lock); |
|---|
| 321 | | - ret = idr_alloc_cyclic(&qmi->txns, txn, 0, INT_MAX, GFP_KERNEL); |
|---|
| 321 | + ret = idr_alloc_cyclic(&qmi->txns, txn, 0, U16_MAX, GFP_KERNEL); |
|---|
| 322 | 322 | if (ret < 0) |
|---|
| 323 | 323 | pr_err("failed to allocate transaction id\n"); |
|---|
| 324 | 324 | |
|---|
| .. | .. |
|---|
| 345 | 345 | struct qmi_handle *qmi = txn->qmi; |
|---|
| 346 | 346 | int ret; |
|---|
| 347 | 347 | |
|---|
| 348 | | - ret = wait_for_completion_interruptible_timeout(&txn->completion, |
|---|
| 349 | | - timeout); |
|---|
| 348 | + ret = wait_for_completion_timeout(&txn->completion, timeout); |
|---|
| 350 | 349 | |
|---|
| 351 | 350 | mutex_lock(&qmi->txn_lock); |
|---|
| 352 | 351 | mutex_lock(&txn->lock); |
|---|
| .. | .. |
|---|
| 354 | 353 | mutex_unlock(&txn->lock); |
|---|
| 355 | 354 | mutex_unlock(&qmi->txn_lock); |
|---|
| 356 | 355 | |
|---|
| 357 | | - if (ret < 0) |
|---|
| 358 | | - return ret; |
|---|
| 359 | | - else if (ret == 0) |
|---|
| 356 | + if (ret == 0) |
|---|
| 360 | 357 | return -ETIMEDOUT; |
|---|
| 361 | 358 | else |
|---|
| 362 | 359 | return txn->result; |
|---|
| .. | .. |
|---|
| 658 | 655 | |
|---|
| 659 | 656 | qmi->sock = qmi_sock_create(qmi, &qmi->sq); |
|---|
| 660 | 657 | if (IS_ERR(qmi->sock)) { |
|---|
| 661 | | - pr_err("failed to create QMI socket\n"); |
|---|
| 662 | | - ret = PTR_ERR(qmi->sock); |
|---|
| 658 | + if (PTR_ERR(qmi->sock) == -EAFNOSUPPORT) { |
|---|
| 659 | + ret = -EPROBE_DEFER; |
|---|
| 660 | + } else { |
|---|
| 661 | + pr_err("failed to create QMI socket\n"); |
|---|
| 662 | + ret = PTR_ERR(qmi->sock); |
|---|
| 663 | + } |
|---|
| 663 | 664 | goto err_destroy_wq; |
|---|
| 664 | 665 | } |
|---|
| 665 | 666 | |
|---|