return dev_err_probe(scm->dev, PTR_ERR(scm->mempool),
"Failed to create the SCM memory pool\n");
+ irq = platform_get_irq_optional(pdev, 0);
+ if (irq < 0) {
+ if (irq != -ENXIO)
+ return irq;
+ } else {
+ ret = devm_request_threaded_irq(scm->dev, irq, NULL, qcom_scm_irq_handler,
+ IRQF_ONESHOT, "qcom-scm", scm);
+ if (ret < 0)
+ return dev_err_probe(scm->dev, ret,
+ "Failed to request qcom-scm irq\n");
+ }
+
/*
* Paired with smp_load_acquire() in qcom_scm_is_available().
*
* This marks the SCM API as ready to accept user calls and can only
- * be called after the TrustZone memory pool is initialized.
+ * be called after the TrustZone memory pool is initialized and the
+ * waitqueue interrupt requested.
*/
smp_store_release(&__scm, scm);
- irq = platform_get_irq_optional(pdev, 0);
- if (irq < 0) {
- if (irq != -ENXIO) {
- ret = irq;
- goto err;
- }
- } else {
- ret = devm_request_threaded_irq(__scm->dev, irq, NULL, qcom_scm_irq_handler,
- IRQF_ONESHOT, "qcom-scm", __scm);
- if (ret < 0) {
- dev_err_probe(scm->dev, ret, "Failed to request qcom-scm irq\n");
- goto err;
- }
- }
-
__get_convention();
/*
WARN(ret < 0, "failed to initialize qseecom: %d\n", ret);
return 0;
-
-err:
- /* Paired with smp_load_acquire() in qcom_scm_is_available(). */
- smp_store_release(&__scm, NULL);
-
- return ret;
}
static void qcom_scm_shutdown(struct platform_device *pdev)