diff options
| -rw-r--r-- | drivers/soc/qcom/subsystem_restart.c | 22 | ||||
| -rw-r--r-- | include/soc/qcom/subsystem_restart.h | 6 |
2 files changed, 28 insertions, 0 deletions
diff --git a/drivers/soc/qcom/subsystem_restart.c b/drivers/soc/qcom/subsystem_restart.c index 0ed8a6533e00..76d941ceb77e 100644 --- a/drivers/soc/qcom/subsystem_restart.c +++ b/drivers/soc/qcom/subsystem_restart.c @@ -746,6 +746,28 @@ static void subsys_stop(struct subsys_device *subsys) notify_each_subsys_device(&subsys, 1, SUBSYS_AFTER_SHUTDOWN, NULL); } +int subsystem_set_fwname(const char *name, const char *fw_name) +{ + struct subsys_device *subsys; + + if (!name) + return -EINVAL; + + if (!fw_name) + return -EINVAL; + + subsys = find_subsys(name); + if (!subsys) + return -EINVAL; + + pr_debug("Changing subsys [%s] fw_name to [%s]\n", name, fw_name); + strlcpy(subsys->desc->fw_name, fw_name, + sizeof(subsys->desc->fw_name)); + + return 0; +} +EXPORT_SYMBOL(subsystem_set_fwname); + void *__subsystem_get(const char *name, const char *fw_name) { struct subsys_device *subsys; diff --git a/include/soc/qcom/subsystem_restart.h b/include/soc/qcom/subsystem_restart.h index 3a5f6e678b4f..780666c332e2 100644 --- a/include/soc/qcom/subsystem_restart.h +++ b/include/soc/qcom/subsystem_restart.h @@ -113,6 +113,7 @@ extern int subsystem_crashed(const char *name); extern void *subsystem_get(const char *name); extern void *subsystem_get_with_fwname(const char *name, const char *fw_name); +extern int subsystem_set_fwname(const char *name, const char *fw_name); extern void subsystem_put(void *subsystem); extern struct subsys_device *subsys_register(struct subsys_desc *desc); @@ -157,6 +158,11 @@ static inline void *subsystem_get_with_fwname(const char *name, return NULL; } +static inline int subsystem_set_fwname(const char *name, + const char *fw_name) { + return 0; +} + static inline void subsystem_put(void *subsystem) { } static inline |
