Commit 73b1c90d authored by Saurabh Sengar's avatar Saurabh Sengar Committed by David S. Miller

net: fec: no need to test for the return type of of_property_read_u32

in case of error no need to set num_tx and num_rx = 1, because in case of error
these variables will remain unchanged by of_property_read_u32 ie 1 only
Signed-off-by: default avatarSaurabh Sengar <saurabh.truth@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 724fe695
...@@ -3277,7 +3277,6 @@ static void ...@@ -3277,7 +3277,6 @@ static void
fec_enet_get_queue_num(struct platform_device *pdev, int *num_tx, int *num_rx) fec_enet_get_queue_num(struct platform_device *pdev, int *num_tx, int *num_rx)
{ {
struct device_node *np = pdev->dev.of_node; struct device_node *np = pdev->dev.of_node;
int err;
*num_tx = *num_rx = 1; *num_tx = *num_rx = 1;
...@@ -3285,13 +3284,9 @@ fec_enet_get_queue_num(struct platform_device *pdev, int *num_tx, int *num_rx) ...@@ -3285,13 +3284,9 @@ fec_enet_get_queue_num(struct platform_device *pdev, int *num_tx, int *num_rx)
return; return;
/* parse the num of tx and rx queues */ /* parse the num of tx and rx queues */
err = of_property_read_u32(np, "fsl,num-tx-queues", num_tx); of_property_read_u32(np, "fsl,num-tx-queues", num_tx);
if (err)
*num_tx = 1;
err = of_property_read_u32(np, "fsl,num-rx-queues", num_rx); of_property_read_u32(np, "fsl,num-rx-queues", num_rx);
if (err)
*num_rx = 1;
if (*num_tx < 1 || *num_tx > FEC_ENET_MAX_TX_QS) { if (*num_tx < 1 || *num_tx > FEC_ENET_MAX_TX_QS) {
dev_warn(&pdev->dev, "Invalid num_tx(=%d), fall back to 1\n", dev_warn(&pdev->dev, "Invalid num_tx(=%d), fall back to 1\n",
......
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