Commit 5b6cb43b authored by Ivan Khoronzhuk's avatar Ivan Khoronzhuk Committed by David S. Miller

net: ethernet: ti: netcp_core: return error while dma channel open issue

Fix error path while dma open channel issue. Also, no need to check output
on NULL if it's never returned.
Signed-off-by: default avatarIvan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent dc319c4b
...@@ -1353,9 +1353,10 @@ int netcp_txpipe_open(struct netcp_tx_pipe *tx_pipe) ...@@ -1353,9 +1353,10 @@ int netcp_txpipe_open(struct netcp_tx_pipe *tx_pipe)
tx_pipe->dma_channel = knav_dma_open_channel(dev, tx_pipe->dma_channel = knav_dma_open_channel(dev,
tx_pipe->dma_chan_name, &config); tx_pipe->dma_chan_name, &config);
if (IS_ERR_OR_NULL(tx_pipe->dma_channel)) { if (IS_ERR(tx_pipe->dma_channel)) {
dev_err(dev, "failed opening tx chan(%s)\n", dev_err(dev, "failed opening tx chan(%s)\n",
tx_pipe->dma_chan_name); tx_pipe->dma_chan_name);
ret = PTR_ERR(tx_pipe->dma_channel);
goto err; goto err;
} }
...@@ -1673,9 +1674,10 @@ static int netcp_setup_navigator_resources(struct net_device *ndev) ...@@ -1673,9 +1674,10 @@ static int netcp_setup_navigator_resources(struct net_device *ndev)
netcp->rx_channel = knav_dma_open_channel(netcp->netcp_device->device, netcp->rx_channel = knav_dma_open_channel(netcp->netcp_device->device,
netcp->dma_chan_name, &config); netcp->dma_chan_name, &config);
if (IS_ERR_OR_NULL(netcp->rx_channel)) { if (IS_ERR(netcp->rx_channel)) {
dev_err(netcp->ndev_dev, "failed opening rx chan(%s\n", dev_err(netcp->ndev_dev, "failed opening rx chan(%s\n",
netcp->dma_chan_name); netcp->dma_chan_name);
ret = PTR_ERR(netcp->rx_channel);
goto fail; goto fail;
} }
......
...@@ -413,7 +413,7 @@ static int of_channel_match_helper(struct device_node *np, const char *name, ...@@ -413,7 +413,7 @@ static int of_channel_match_helper(struct device_node *np, const char *name,
* @name: slave channel name * @name: slave channel name
* @config: dma configuration parameters * @config: dma configuration parameters
* *
* Returns pointer to appropriate DMA channel on success or NULL. * Returns pointer to appropriate DMA channel on success or error.
*/ */
void *knav_dma_open_channel(struct device *dev, const char *name, void *knav_dma_open_channel(struct device *dev, const char *name,
struct knav_dma_cfg *config) struct knav_dma_cfg *config)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment