All callers have been migrated to qcom_pas_prepare_and_auth_reset(),
which additionally sets up a shmbridge over firmware memory before
TrustZone authentication.  Remove the bare pas_id-only wrapper, its
EXPORT_SYMBOL_GPL, the header declaration, the auth_and_reset ops slot
from struct qcom_pas_ops and both backend implementations.

The internal helper functions (__qcom_scm_pas_auth_and_reset,
__qcom_pas_tee_auth_and_reset) remain as they are called directly by
their respective prepare_and_auth_reset implementations.

Signed-off-by: Mukesh Ojha <[email protected]>
---
 drivers/firmware/qcom/qcom_pas.c       | 16 ----------------
 drivers/firmware/qcom/qcom_pas.h       |  3 ---
 drivers/firmware/qcom/qcom_pas_tee.c   |  6 ------
 drivers/firmware/qcom/qcom_scm.c       |  7 +++----
 include/linux/firmware/qcom/qcom_pas.h |  1 -
 5 files changed, 3 insertions(+), 30 deletions(-)

diff --git a/drivers/firmware/qcom/qcom_pas.c b/drivers/firmware/qcom/qcom_pas.c
index 93d78a5c1201..6de6d62adfde 100644
--- a/drivers/firmware/qcom/qcom_pas.c
+++ b/drivers/firmware/qcom/qcom_pas.c
@@ -166,22 +166,6 @@ struct resource_table *qcom_pas_get_rsc_table(struct 
qcom_pas_context *ctx,
 }
 EXPORT_SYMBOL_GPL(qcom_pas_get_rsc_table);
 
-/**
- * qcom_pas_auth_and_reset() - Authenticate the given peripheral firmware
- *                            and reset the remote processor
- * @pas_id:    peripheral authentication service id
- *
- * Return: 0 on success.
- */
-int qcom_pas_auth_and_reset(u32 pas_id)
-{
-       if (!ops_ptr)
-               return -ENODEV;
-
-       return ops_ptr->auth_and_reset(ops_ptr->dev, pas_id);
-}
-EXPORT_SYMBOL_GPL(qcom_pas_auth_and_reset);
-
 /**
  * qcom_pas_prepare_and_auth_reset() - Prepare, authenticate, and reset the
  *                                    remote processor
diff --git a/drivers/firmware/qcom/qcom_pas.h b/drivers/firmware/qcom/qcom_pas.h
index 8643e2760602..a296be2be8c0 100644
--- a/drivers/firmware/qcom/qcom_pas.h
+++ b/drivers/firmware/qcom/qcom_pas.h
@@ -18,8 +18,6 @@ struct device;
  * @get_rsc_table:             Peripheral get resource table callback.
  * @prepare_and_auth_reset:    Peripheral prepare firmware authentication and
  *                             reset callback.
- * @auth_and_reset:            Peripheral firmware authentication and reset
- *                             callback.
  * @set_remote_state:          Peripheral set remote state callback.
  * @shutdown:                  Peripheral shutdown callback.
  * @metadata_release:          Image metadata release callback.
@@ -37,7 +35,6 @@ struct qcom_pas_ops {
                               size_t *output_rt_size);
        int (*prepare_and_auth_reset)(struct device *dev,
                                      struct qcom_pas_context *ctx);
-       int (*auth_and_reset)(struct device *dev, u32 pas_id);
        int (*set_remote_state)(struct device *dev, u32 state, u32 pas_id);
        int (*shutdown)(struct device *dev, u32 pas_id);
        void (*metadata_release)(struct device *dev,
diff --git a/drivers/firmware/qcom/qcom_pas_tee.c 
b/drivers/firmware/qcom/qcom_pas_tee.c
index ac33a00687aa..dbab9a43e6ca 100644
--- a/drivers/firmware/qcom/qcom_pas_tee.c
+++ b/drivers/firmware/qcom/qcom_pas_tee.c
@@ -320,11 +320,6 @@ static int __qcom_pas_tee_auth_and_reset(struct device 
*dev, u32 pas_id,
        return ret;
 }
 
-static int qcom_pas_tee_auth_and_reset(struct device *dev, u32 pas_id)
-{
-       return __qcom_pas_tee_auth_and_reset(dev, pas_id, 0, 0);
-}
-
 static int qcom_pas_tee_prepare_and_auth_reset(struct device *dev,
                                               struct qcom_pas_context *ctx)
 {
@@ -401,7 +396,6 @@ static struct qcom_pas_ops qcom_pas_ops_tee = {
        .init_image             = qcom_pas_tee_init_image,
        .mem_setup              = qcom_pas_tee_mem_setup,
        .get_rsc_table          = qcom_pas_tee_get_rsc_table,
-       .auth_and_reset         = qcom_pas_tee_auth_and_reset,
        .prepare_and_auth_reset = qcom_pas_tee_prepare_and_auth_reset,
        .set_remote_state       = qcom_pas_tee_set_remote_state,
        .shutdown               = qcom_pas_tee_shutdown,
diff --git a/drivers/firmware/qcom/qcom_scm.c b/drivers/firmware/qcom/qcom_scm.c
index dc57c87870cf..08b9c5049dd9 100644
--- a/drivers/firmware/qcom/qcom_scm.c
+++ b/drivers/firmware/qcom/qcom_scm.c
@@ -845,7 +845,7 @@ static void *qcom_scm_pas_get_rsc_table(struct device *dev,
        return ret ? ERR_PTR(ret) : tbl_ptr;
 }
 
-static int qcom_scm_pas_auth_and_reset(struct device *dev, u32 pas_id)
+static int __qcom_scm_pas_auth_and_reset(struct device *dev, u32 pas_id)
 {
        int ret;
        struct qcom_scm_desc desc = {
@@ -886,7 +886,7 @@ static int qcom_scm_pas_prepare_and_auth_reset(struct 
device *dev,
         * memory region and then invokes a call to TrustZone to authenticate.
         */
        if (!ctx->use_tzmem)
-               return qcom_scm_pas_auth_and_reset(dev, ctx->pas_id);
+               return __qcom_scm_pas_auth_and_reset(dev, ctx->pas_id);
 
        /*
         * When Linux runs @ EL2 Linux must create the shmbridge itself and then
@@ -896,7 +896,7 @@ static int qcom_scm_pas_prepare_and_auth_reset(struct 
device *dev,
        if (ret)
                return ret;
 
-       ret = qcom_scm_pas_auth_and_reset(dev, ctx->pas_id);
+       ret = __qcom_scm_pas_auth_and_reset(dev, ctx->pas_id);
        qcom_tzmem_shm_bridge_delete(handle);
 
        return ret;
@@ -977,7 +977,6 @@ static struct qcom_pas_ops qcom_pas_ops_scm = {
        .init_image             = qcom_scm_pas_init_image,
        .mem_setup              = qcom_scm_pas_mem_setup,
        .get_rsc_table          = qcom_scm_pas_get_rsc_table,
-       .auth_and_reset         = qcom_scm_pas_auth_and_reset,
        .prepare_and_auth_reset = qcom_scm_pas_prepare_and_auth_reset,
        .set_remote_state       = qcom_scm_pas_set_remote_state,
        .shutdown               = qcom_scm_pas_shutdown,
diff --git a/include/linux/firmware/qcom/qcom_pas.h 
b/include/linux/firmware/qcom/qcom_pas.h
index 1d132e89536e..07d0f1fad85f 100644
--- a/include/linux/firmware/qcom/qcom_pas.h
+++ b/include/linux/firmware/qcom/qcom_pas.h
@@ -46,7 +46,6 @@ struct resource_table *qcom_pas_get_rsc_table(struct 
qcom_pas_context *ctx,
                                              void *input_rt, size_t 
input_rt_size,
                                              size_t *output_rt_size);
 int qcom_pas_mem_setup(u32 pas_id, phys_addr_t addr, phys_addr_t size);
-int qcom_pas_auth_and_reset(u32 pas_id);
 int qcom_pas_prepare_and_auth_reset(struct qcom_pas_context *ctx);
 int qcom_pas_set_remote_state(u32 state, u32 pas_id);
 int qcom_pas_shutdown(u32 pas_id);
-- 
2.55.0


Reply via email to