diff options
author | M Chetan Kumar <m.chetan.kumar@linux.intel.com> | 2021-09-21 22:17:36 +0530 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-09-22 14:23:33 +0100 |
commit | 8bea96efa7c0c57dc0c9ec4518ed61e3d5e9261c (patch) | |
tree | 8c8c530a903dea5bc10e3d930785b1461da66307 /drivers/net/wwan/iosm/iosm_ipc_coredump.c | |
parent | a5df6333f1a08380c3b94a02105482263711ed3a (diff) |
net: wwan: iosm: fw flashing and cd improvements
1> Function comments moved to .c file.
2> Use literals in return to improve readability.
3> Do error handling check instead of success check.
4> Redundant ret assignment removed.
Signed-off-by: M Chetan Kumar <m.chetan.kumar@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wwan/iosm/iosm_ipc_coredump.c')
-rw-r--r-- | drivers/net/wwan/iosm/iosm_ipc_coredump.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/drivers/net/wwan/iosm/iosm_ipc_coredump.c b/drivers/net/wwan/iosm/iosm_ipc_coredump.c index fba3c3454e80..9acd87724c9d 100644 --- a/drivers/net/wwan/iosm/iosm_ipc_coredump.c +++ b/drivers/net/wwan/iosm/iosm_ipc_coredump.c @@ -5,7 +5,15 @@ #include "iosm_ipc_coredump.h" -/* Collect coredump data from modem */ +/** + * ipc_coredump_collect - To collect coredump + * @devlink: Pointer to devlink instance. + * @data: Pointer to snapshot + * @entry: ID of requested snapshot + * @region_size: Region size + * + * Returns: 0 on success, error on failure + */ int ipc_coredump_collect(struct iosm_devlink *devlink, u8 **data, int entry, u32 region_size) { @@ -38,20 +46,27 @@ int ipc_coredump_collect(struct iosm_devlink *devlink, u8 **data, int entry, *data = data_ptr; - return ret; + return 0; + get_cd_fail: vfree(data_ptr); return ret; } -/* Get coredump list to be collected from modem */ +/** + * ipc_coredump_get_list - Get coredump list from modem + * @devlink: Pointer to devlink instance. + * @cmd: RPSI command to be sent + * + * Returns: 0 on success, error on failure + */ int ipc_coredump_get_list(struct iosm_devlink *devlink, u16 cmd) { u32 byte_read, num_entries, file_size; struct iosm_cd_table *cd_table; u8 size[MAX_SIZE_LEN], i; char *filename; - int ret = 0; + int ret; cd_table = kzalloc(MAX_CD_LIST_SIZE, GFP_KERNEL); if (!cd_table) { |