Skip to content

Commit

Permalink
soc: qcom: mdt_loader: define stubs for COMPILE_TEST
Browse files Browse the repository at this point in the history
Define stub functions for the exposed MDT functions in case
QCOM_MDT_LOADER is not configured.  This allows users of these
functions to link correctly for COMPILE_TEST builds without
QCOM_SCM enabled.

Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Alex Elder authored and Jakub Kicinski committed Jan 9, 2021
1 parent 9941222 commit ce2ceb9
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions include/linux/soc/qcom/mdt_loader.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
struct device;
struct firmware;

#if IS_ENABLED(CONFIG_QCOM_MDT_LOADER)

ssize_t qcom_mdt_get_size(const struct firmware *fw);
int qcom_mdt_load(struct device *dev, const struct firmware *fw,
const char *fw_name, int pas_id, void *mem_region,
Expand All @@ -23,4 +25,37 @@ int qcom_mdt_load_no_init(struct device *dev, const struct firmware *fw,
phys_addr_t *reloc_base);
void *qcom_mdt_read_metadata(const struct firmware *fw, size_t *data_len);

#else /* !IS_ENABLED(CONFIG_QCOM_MDT_LOADER) */

static inline ssize_t qcom_mdt_get_size(const struct firmware *fw)
{
return -ENODEV;
}

static inline int qcom_mdt_load(struct device *dev, const struct firmware *fw,
const char *fw_name, int pas_id,
void *mem_region, phys_addr_t mem_phys,
size_t mem_size, phys_addr_t *reloc_base)
{
return -ENODEV;
}

static inline int qcom_mdt_load_no_init(struct device *dev,
const struct firmware *fw,
const char *fw_name, int pas_id,
void *mem_region, phys_addr_t mem_phys,
size_t mem_size,
phys_addr_t *reloc_base)
{
return -ENODEV;
}

static inline void *qcom_mdt_read_metadata(const struct firmware *fw,
size_t *data_len)
{
return ERR_PTR(-ENODEV);
}

#endif /* !IS_ENABLED(CONFIG_QCOM_MDT_LOADER) */

#endif

0 comments on commit ce2ceb9

Please sign in to comment.