diff options
author | Dilip Kota <dkota@codeaurora.org> | 2016-06-30 20:28:40 +0530 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2016-08-11 22:30:28 -0700 |
commit | b5bc5681c579048b434e435edb23f40905615e76 (patch) | |
tree | 5f259cd3b367e9644ad9c5aca1e74151adeb669a /drivers/slimbus | |
parent | f303bb651bcc4bc53482ce9f32ceddbbb7ad4f71 (diff) |
slim-msm: Handling resources during port de-allocation
In port de-allocate operation free the resources
only if port is connected as memory allocates while
connecting the port.
Change-Id: I743a27025e83f0f4bb8a47c20b2bb2d4cff80caa
Signed-off-by: Dilip Kota <dkota@codeaurora.org>
Diffstat (limited to 'drivers/slimbus')
-rw-r--r-- | drivers/slimbus/slim-msm.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/slimbus/slim-msm.c b/drivers/slimbus/slim-msm.c index 1ca5109615fe..0509b46948cb 100644 --- a/drivers/slimbus/slim-msm.c +++ b/drivers/slimbus/slim-msm.c @@ -392,13 +392,13 @@ void msm_dealloc_port(struct slim_controller *ctrl, u8 pn) if (pn >= dev->port_nums) return; endpoint = &dev->pipes[pn]; - if (dev->pipes[pn].connected) - msm_slim_disconn_pipe_port(dev, pn); - if (endpoint->sps) { + if (dev->pipes[pn].connected) { struct sps_connect *config = &endpoint->config; - msm_slim_free_endpoint(endpoint); + msm_slim_disconn_pipe_port(dev, pn); msm_slim_sps_mem_free(dev, &config->desc); } + if (endpoint->sps) + msm_slim_free_endpoint(endpoint); } enum slim_port_err msm_slim_port_xfer_status(struct slim_controller *ctr, |