qcacmn: Correct the return types of functions in HIF component

A few functions in HIF component returns QDF status value with return
type as non QDF STATUS and vice versa. For such functions, update the
correct return type.

Change-Id: I806407dd0596cd03500242d97ca8220a7beb6c55
CRs-Fixed: 2734818
This commit is contained in:
Shashikala Prabhu
2020-07-17 12:58:53 +05:30
committed by snandini
parent cb2acc0ea0
commit ba0276b572
11 changed files with 77 additions and 54 deletions

View File

@@ -426,8 +426,9 @@ static inline void hif_record_event(struct hif_opaque_softc *hif_ctx,
event.tp = tp;
event.type = type;
return hif_hist_record_event(hif_ctx, &event,
intr_grp_id);
hif_hist_record_event(hif_ctx, &event, intr_grp_id);
return;
}
#else

View File

@@ -1168,8 +1168,10 @@ static void hif_prepare_hal_shadow_register_cfg(struct hif_softc *scn,
int *num_shadow_registers_configured) {
struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(scn);
return hif_state->ce_services->ce_prepare_shadow_register_v2_cfg(
hif_state->ce_services->ce_prepare_shadow_register_v2_cfg(
scn, shadow_config, num_shadow_registers_configured);
return;
}
static inline uint32_t ce_get_desc_size(struct hif_softc *scn,

View File

@@ -1077,7 +1077,9 @@ void hif_pm_runtime_mark_last_busy(struct hif_opaque_softc *hif_ctx)
rpm_ctx->pm_stats.last_busy_marker = (void *)_RET_IP_;
rpm_ctx->pm_stats.last_busy_timestamp = qdf_get_log_timestamp_usecs();
return pm_runtime_mark_last_busy(hif_bus_get_dev(scn));
pm_runtime_mark_last_busy(hif_bus_get_dev(scn));
return;
}
/**

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013-2019 The Linux Foundation. All rights reserved.
* Copyright (c) 2013-2020 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -159,7 +159,6 @@ QDF_STATUS hif_sdio_enable_bus(struct hif_softc *ol_sc, struct device *dev,
void *bdev, const struct hif_bus_id *bid,
enum hif_enable_type type)
{
int ret = 0;
const struct sdio_device_id *id = (const struct sdio_device_id *)bid;
if (hif_sdio_device_inserted(ol_sc, dev, id)) {
@@ -167,7 +166,7 @@ QDF_STATUS hif_sdio_enable_bus(struct hif_softc *ol_sc, struct device *dev,
return QDF_STATUS_E_NOMEM;
}
return ret;
return QDF_STATUS_SUCCESS;
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013-2019 The Linux Foundation. All rights reserved.
* Copyright (c) 2013-2020 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -78,9 +78,19 @@ int ath_sdio_resume(void *context);
void hif_init_qdf_ctx(qdf_device_t qdf_dev, void *ol_sc);
void hif_deinit_qdf_ctx(void *ol_sc);
int hif_sdio_device_inserted(struct hif_softc *ol_sc,
struct device *dev,
const struct sdio_device_id *id);
/**
* hif_sdio_device_inserted() - Wrapper function for hif-sdio driver probe
* handler
* @ol_sc: HIF device context
* @dev: pointer to device structure
* @id: pointer to sdio_device_id
*
* Return: QDF_STATUS
*/
QDF_STATUS hif_sdio_device_inserted(struct hif_softc *ol_sc,
struct device *dev,
const struct sdio_device_id *id);
void hif_sdio_stop(struct hif_softc *hif_ctx);
void hif_sdio_shutdown(struct hif_softc *hif_ctx);
void hif_sdio_device_removed(struct hif_softc *hif_ctx, struct sdio_func *func);

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013-2019 The Linux Foundation. All rights reserved.
* Copyright (c) 2013-2020 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -403,9 +403,10 @@ static int hif_cmd52_write_byte_8bit(struct sdio_func *func)
* @ol_sc: softc instance
* @func: pointer to sdio_func
*
* Return: 0 on success, error number otherwise.
* Return: QDF_STATUS
*/
int hif_sdio_set_bus_speed(struct hif_softc *ol_sc, struct sdio_func *func)
QDF_STATUS hif_sdio_set_bus_speed(struct hif_softc *ol_sc,
struct sdio_func *func)
{
uint32_t clock, clock_set = 12500000;
struct hif_sdio_dev *device = get_hif_device(ol_sc, func);
@@ -414,7 +415,7 @@ int hif_sdio_set_bus_speed(struct hif_softc *ol_sc, struct sdio_func *func)
manfid = device->id->device & MANUFACTURER_ID_AR6K_BASE_MASK;
if (manfid == MANUFACTURER_ID_QCN7605_BASE)
return 0;
return QDF_STATUS_SUCCESS;
if (mmcclock > 0)
clock_set = mmcclock;
@@ -442,31 +443,33 @@ int hif_sdio_set_bus_speed(struct hif_softc *ol_sc, struct sdio_func *func)
&device->host->ios);
}
return 0;
return QDF_STATUS_SUCCESS;
}
/**
* hif_set_bus_width() - Set the sdio bus width
* hif_sdio_set_bus_width() - Set the sdio bus width
* @ol_sc: softc instance
* @func: pointer to sdio_func
*
* Return: 0 on success, error number otherwise.
* Return: QDF_STATUS
*/
int hif_sdio_set_bus_width(struct hif_softc *ol_sc, struct sdio_func *func)
QDF_STATUS hif_sdio_set_bus_width(struct hif_softc *ol_sc,
struct sdio_func *func)
{
int ret = 0;
uint16_t manfid;
uint8_t data = 0;
struct hif_sdio_dev *device = get_hif_device(ol_sc, func);
QDF_STATUS status = QDF_STATUS_SUCCESS;
manfid = device->id->device & MANUFACTURER_ID_AR6K_BASE_MASK;
if (manfid == MANUFACTURER_ID_QCN7605_BASE)
return ret;
return status;
#if KERNEL_VERSION(3, 4, 0) <= LINUX_VERSION_CODE
if (mmcbuswidth == 0)
return ret;
return status;
/* Set MMC Bus Width: 1-1Bit, 4-4Bit, 8-8Bit */
if (mmcbuswidth == 1) {
@@ -504,12 +507,16 @@ int hif_sdio_set_bus_width(struct hif_softc *ol_sc, struct sdio_func *func)
} else {
HIF_ERROR("%s: Unsupported bus width %d",
__func__, mmcbuswidth);
ret = QDF_STATUS_E_FAILURE;
status = QDF_STATUS_E_FAILURE;
goto out;
}
status = qdf_status_from_os_return(ret);
out:
HIF_INFO("%s: Bus with : %d\n", __func__, mmcbuswidth);
#endif
return ret;
return status;
}
@@ -666,7 +673,7 @@ QDF_STATUS reinit_sdio(struct hif_sdio_dev *device)
manfid = device->id->device & MANUFACTURER_ID_AR6K_BASE_MASK;
if (manfid == MANUFACTURER_ID_QCN7605_BASE)
return 0;
return QDF_STATUS_SUCCESS;
sdio_claim_host(func);

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013-2019 The Linux Foundation. All rights reserved.
* Copyright (c) 2013-2020 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -277,15 +277,16 @@ static int sdio_enable4bits(struct hif_sdio_dev *device, int enable)
* @func: SDIO function context
* @device: pointer to hif handle
*
* Return: 0 for success and non-zero for failure
* Return: QDF_STATUS
*/
A_STATUS hif_sdio_probe(struct hif_softc *ol_sc,
struct sdio_func *func,
struct hif_sdio_dev *device)
QDF_STATUS hif_sdio_probe(struct hif_softc *ol_sc,
struct sdio_func *func,
struct hif_sdio_dev *device)
{
int ret = 0;
const struct sdio_device_id *id;
uint32_t target_type;
QDF_STATUS status = QDF_STATUS_SUCCESS;
HIF_ENTER();
scn = (struct hif_sdio_softc *)ol_sc;
@@ -357,19 +358,19 @@ A_STATUS hif_sdio_probe(struct hif_softc *ol_sc,
}
if (athdiag_procfs_init(scn) != 0) {
ret = QDF_STATUS_E_FAILURE;
status = QDF_STATUS_E_FAILURE;
goto err_attach1;
}
ret = hif_dev_register_channels(device, func);
return ret;
return qdf_status_from_os_return(ret);
err_attach1:
if (scn->ramdump_base)
pld_hif_sdio_release_ramdump_mem(scn->ramdump_base);
scn = NULL;
return ret;
return status;
}
/**
@@ -567,13 +568,14 @@ void hif_sdio_shutdown(struct hif_softc *hif_ctx)
* @func: pointer to sdio_func
* @id: pointer to sdio_device_id
*
* Return: 0 on success, error number otherwise.
* Return: QDF_STATUS
*/
static int hif_device_inserted(struct hif_softc *ol_sc,
struct sdio_func *func,
const struct sdio_device_id *id)
static QDF_STATUS hif_device_inserted(struct hif_softc *ol_sc,
struct sdio_func *func,
const struct sdio_device_id *id)
{
int i, ret = 0, count;
int i, count;
QDF_STATUS ret = QDF_STATUS_SUCCESS;
struct hif_sdio_dev *device = NULL;
HIF_INFO("%s: F%X, VID: 0x%X, DevID: 0x%X, block size: 0x%X/0x%X\n",
@@ -665,7 +667,7 @@ static int hif_device_inserted(struct hif_softc *ol_sc,
ret = hif_enable_func(ol_sc, device, func, false);
if ((ret == QDF_STATUS_SUCCESS || ret == QDF_STATUS_E_PENDING))
return 0;
return QDF_STATUS_SUCCESS;
ret = QDF_STATUS_E_FAILURE;
del_hif_dev:
del_hif_device(device);
@@ -1078,12 +1080,12 @@ void hif_dump_cccr(struct hif_sdio_dev *hif_device)
HIF_ERROR("%s: Exit", __func__);
}
int hif_sdio_device_inserted(struct hif_softc *ol_sc,
struct device *dev,
const struct sdio_device_id *id)
QDF_STATUS hif_sdio_device_inserted(struct hif_softc *ol_sc,
struct device *dev,
const struct sdio_device_id *id)
{
struct sdio_func *func = dev_to_sdio_func(dev);
int status = 0;
QDF_STATUS status = QDF_STATUS_SUCCESS;
HIF_ERROR("%s: Enter", __func__);
status = hif_device_inserted(ol_sc, func, id);

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019 The Linux Foundation. All rights reserved.
* Copyright (c) 2019-2020 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -344,7 +344,7 @@ QDF_STATUS hif_disable_func(struct hif_sdio_dev *device,
QDF_STATUS hif_enable_func(struct hif_softc *ol_sc, struct hif_sdio_dev *device,
struct sdio_func *func, bool resume)
{
int ret = QDF_STATUS_SUCCESS;
QDF_STATUS ret = QDF_STATUS_SUCCESS;
if (!device) {
HIF_ERROR("%s: HIF device is NULL", __func__);

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013-2019 The Linux Foundation. All rights reserved.
* Copyright (c) 2013-2020 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -1563,10 +1563,10 @@ hif_read_write(struct hif_sdio_dev *device,
* @device: HIF device object
* @func: function pointer
*
* Return success or failure
* Return QDF_STATUS
*/
static int hif_sdio_func_enable(struct hif_softc *ol_sc,
struct sdio_func *func)
static QDF_STATUS hif_sdio_func_enable(struct hif_softc *ol_sc,
struct sdio_func *func)
{
struct hif_sdio_dev *device = get_hif_device(ol_sc, func);
@@ -1611,7 +1611,7 @@ static int hif_sdio_func_enable(struct hif_softc *ol_sc,
sdio_release_host(func);
}
return 0;
return QDF_STATUS_SUCCESS;
}
/**
@@ -1941,7 +1941,7 @@ QDF_STATUS hif_disable_func(struct hif_sdio_dev *device,
QDF_STATUS hif_enable_func(struct hif_softc *ol_sc, struct hif_sdio_dev *device,
struct sdio_func *func, bool resume)
{
int ret = QDF_STATUS_SUCCESS;
QDF_STATUS ret = QDF_STATUS_SUCCESS;
HIF_ENTER();

View File

@@ -276,7 +276,7 @@ QDF_STATUS hif_snoc_enable_bus(struct hif_softc *ol_sc,
if (ret) {
HIF_ERROR("%s: failed to set dma mask error = %d",
__func__, ret);
return ret;
return qdf_status_from_os_return(ret);
}
ret = qdf_device_init_wakeup(ol_sc->qdf_dev, true);
@@ -286,7 +286,7 @@ QDF_STATUS hif_snoc_enable_bus(struct hif_softc *ol_sc,
else if (ret) {
HIF_ERROR("%s: device_init_wakeup: err= %d",
__func__, ret);
return ret;
return qdf_status_from_os_return(ret);
}
ret = hif_snoc_get_target_type(ol_sc, dev, bdev, bid,

View File

@@ -188,7 +188,7 @@ QDF_STATUS hif_usb_enable_bus(struct hif_softc *scn,
{
struct usb_interface *interface = (struct usb_interface *)bdev;
struct usb_device_id *id = (struct usb_device_id *)bid;
int ret = 0;
QDF_STATUS ret = QDF_STATUS_SUCCESS;
struct hif_usb_softc *sc;
struct usb_device *usbdev = interface_to_usbdev(interface);
int vendor_id, product_id;
@@ -263,7 +263,7 @@ QDF_STATUS hif_usb_enable_bus(struct hif_softc *scn,
hif_usb_unload_dev_num = usbdev->devnum;
g_usb_sc = sc;
HIF_EXIT();
return 0;
return QDF_STATUS_SUCCESS;
err_reset:
hif_usb_diag_write_cold_reset(scn);