Merge "msm: mhi: initialize variables to default values"
This commit is contained in:
commit
0588796708
6 changed files with 14 additions and 13 deletions
|
@ -942,10 +942,13 @@ net_dev_reg_fail:
|
||||||
netif_napi_del(&(rmnet_mhi_ptr->napi));
|
netif_napi_del(&(rmnet_mhi_ptr->napi));
|
||||||
free_netdev(rmnet_mhi_ptr->dev);
|
free_netdev(rmnet_mhi_ptr->dev);
|
||||||
net_dev_alloc_fail:
|
net_dev_alloc_fail:
|
||||||
mhi_close_channel(rmnet_mhi_ptr->rx_client_handle);
|
if (rmnet_mhi_ptr->rx_client_handle) {
|
||||||
rmnet_mhi_ptr->dev = NULL;
|
mhi_close_channel(rmnet_mhi_ptr->rx_client_handle);
|
||||||
|
rmnet_mhi_ptr->dev = NULL;
|
||||||
|
}
|
||||||
mhi_rx_chan_start_fail:
|
mhi_rx_chan_start_fail:
|
||||||
mhi_close_channel(rmnet_mhi_ptr->tx_client_handle);
|
if (rmnet_mhi_ptr->tx_client_handle)
|
||||||
|
mhi_close_channel(rmnet_mhi_ptr->tx_client_handle);
|
||||||
mhi_tx_chan_start_fail:
|
mhi_tx_chan_start_fail:
|
||||||
rmnet_log(rmnet_mhi_ptr, MSG_INFO, "Exited ret %d.\n", ret);
|
rmnet_log(rmnet_mhi_ptr, MSG_INFO, "Exited ret %d.\n", ret);
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
@ -509,7 +509,7 @@ static int __exit mhi_plat_remove(struct platform_device *pdev)
|
||||||
|
|
||||||
static int __init mhi_init(void)
|
static int __init mhi_init(void)
|
||||||
{
|
{
|
||||||
int r;
|
int r = -EAGAIN;
|
||||||
struct mhi_device_driver *mhi_dev_drv;
|
struct mhi_device_driver *mhi_dev_drv;
|
||||||
|
|
||||||
mhi_dev_drv = kmalloc(sizeof(*mhi_dev_drv), GFP_KERNEL);
|
mhi_dev_drv = kmalloc(sizeof(*mhi_dev_drv), GFP_KERNEL);
|
||||||
|
|
|
@ -141,7 +141,7 @@ int init_mhi_dev_mem(struct mhi_device_ctxt *mhi_dev_ctxt)
|
||||||
size_t mhi_mem_index = 0, ring_len;
|
size_t mhi_mem_index = 0, ring_len;
|
||||||
void *dev_mem_start;
|
void *dev_mem_start;
|
||||||
dma_addr_t dma_dev_mem_start;
|
dma_addr_t dma_dev_mem_start;
|
||||||
int i, r;
|
int i;
|
||||||
|
|
||||||
mhi_dev_ctxt->dev_space.dev_mem_len =
|
mhi_dev_ctxt->dev_space.dev_mem_len =
|
||||||
calculate_mhi_space(mhi_dev_ctxt);
|
calculate_mhi_space(mhi_dev_ctxt);
|
||||||
|
@ -244,7 +244,7 @@ err_ev_alloc:
|
||||||
mhi_dev_ctxt->dev_space.dev_mem_len,
|
mhi_dev_ctxt->dev_space.dev_mem_len,
|
||||||
mhi_dev_ctxt->dev_space.dev_mem_start,
|
mhi_dev_ctxt->dev_space.dev_mem_start,
|
||||||
mhi_dev_ctxt->dev_space.dma_dev_mem_start);
|
mhi_dev_ctxt->dev_space.dma_dev_mem_start);
|
||||||
return r;
|
return -EFAULT;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int mhi_init_events(struct mhi_device_ctxt *mhi_dev_ctxt)
|
static int mhi_init_events(struct mhi_device_ctxt *mhi_dev_ctxt)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright (c) 2014-2016, The Linux Foundation. All rights reserved.
|
/* Copyright (c) 2014-2017, The Linux Foundation. All rights reserved.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License version 2 and
|
* it under the terms of the GNU General Public License version 2 and
|
||||||
|
@ -109,7 +109,6 @@ int mhi_init_mmio(struct mhi_device_ctxt *mhi_dev_ctxt)
|
||||||
u64 pcie_dword_val = 0;
|
u64 pcie_dword_val = 0;
|
||||||
u32 pcie_word_val = 0;
|
u32 pcie_word_val = 0;
|
||||||
u32 i = 0;
|
u32 i = 0;
|
||||||
int ret_val;
|
|
||||||
|
|
||||||
mhi_log(mhi_dev_ctxt, MHI_MSG_INFO,
|
mhi_log(mhi_dev_ctxt, MHI_MSG_INFO,
|
||||||
"~~~ Initializing MMIO ~~~\n");
|
"~~~ Initializing MMIO ~~~\n");
|
||||||
|
@ -131,7 +130,7 @@ int mhi_init_mmio(struct mhi_device_ctxt *mhi_dev_ctxt)
|
||||||
if (mhi_dev_ctxt->core.mhi_ver != MHI_VERSION) {
|
if (mhi_dev_ctxt->core.mhi_ver != MHI_VERSION) {
|
||||||
mhi_log(mhi_dev_ctxt, MHI_MSG_CRITICAL,
|
mhi_log(mhi_dev_ctxt, MHI_MSG_CRITICAL,
|
||||||
"Bad MMIO version, 0x%x\n", mhi_dev_ctxt->core.mhi_ver);
|
"Bad MMIO version, 0x%x\n", mhi_dev_ctxt->core.mhi_ver);
|
||||||
return ret_val;
|
return -ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Enable the channels */
|
/* Enable the channels */
|
||||||
|
|
|
@ -329,7 +329,7 @@ uintptr_t mhi_p2v_addr(struct mhi_device_ctxt *mhi_dev_ctxt,
|
||||||
enum MHI_RING_TYPE type,
|
enum MHI_RING_TYPE type,
|
||||||
u32 chan, uintptr_t phy_ptr)
|
u32 chan, uintptr_t phy_ptr)
|
||||||
{
|
{
|
||||||
uintptr_t virtual_ptr;
|
uintptr_t virtual_ptr = 0;
|
||||||
struct mhi_ring_ctxt *cs = &mhi_dev_ctxt->dev_space.ring_ctxt;
|
struct mhi_ring_ctxt *cs = &mhi_dev_ctxt->dev_space.ring_ctxt;
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
@ -358,7 +358,7 @@ dma_addr_t mhi_v2p_addr(struct mhi_device_ctxt *mhi_dev_ctxt,
|
||||||
enum MHI_RING_TYPE type,
|
enum MHI_RING_TYPE type,
|
||||||
u32 chan, uintptr_t va_ptr)
|
u32 chan, uintptr_t va_ptr)
|
||||||
{
|
{
|
||||||
dma_addr_t phy_ptr;
|
dma_addr_t phy_ptr = 0;
|
||||||
struct mhi_ring_ctxt *cs = &mhi_dev_ctxt->dev_space.ring_ctxt;
|
struct mhi_ring_ctxt *cs = &mhi_dev_ctxt->dev_space.ring_ctxt;
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
|
|
@ -1030,7 +1030,7 @@ error_dts:
|
||||||
static void process_rs232_state(struct uci_client *ctrl_client,
|
static void process_rs232_state(struct uci_client *ctrl_client,
|
||||||
struct mhi_result *result)
|
struct mhi_result *result)
|
||||||
{
|
{
|
||||||
struct rs232_ctrl_msg *rs232_pkt;
|
struct rs232_ctrl_msg *rs232_pkt = result->buf_addr;
|
||||||
struct uci_client *client = NULL;
|
struct uci_client *client = NULL;
|
||||||
struct mhi_uci_ctxt_t *uci_ctxt = ctrl_client->uci_ctxt;
|
struct mhi_uci_ctxt_t *uci_ctxt = ctrl_client->uci_ctxt;
|
||||||
u32 msg_id;
|
u32 msg_id;
|
||||||
|
@ -1051,7 +1051,6 @@ static void process_rs232_state(struct uci_client *ctrl_client,
|
||||||
sizeof(struct rs232_ctrl_msg));
|
sizeof(struct rs232_ctrl_msg));
|
||||||
goto error_size;
|
goto error_size;
|
||||||
}
|
}
|
||||||
rs232_pkt = result->buf_addr;
|
|
||||||
MHI_GET_CTRL_DEST_ID(CTRL_DEST_ID, rs232_pkt, chan);
|
MHI_GET_CTRL_DEST_ID(CTRL_DEST_ID, rs232_pkt, chan);
|
||||||
for (i = 0; i < MHI_SOFTWARE_CLIENT_LIMIT; i++)
|
for (i = 0; i < MHI_SOFTWARE_CLIENT_LIMIT; i++)
|
||||||
if (chan == uci_ctxt->client_handles[i].out_attr.chan_id ||
|
if (chan == uci_ctxt->client_handles[i].out_attr.chan_id ||
|
||||||
|
|
Loading…
Add table
Reference in a new issue