diff options
author | Saurabh Sengar <saurabh.truth@gmail.com> | 2015-11-23 19:21:48 +0530 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-11-24 16:09:47 -0500 |
commit | 73b1c90d3650a81ff9997f6d1ddfda6efb9fac09 (patch) | |
tree | ce753a8344105218d3333cf41b49a5308c93b29f /drivers/net/ethernet | |
parent | 724fe6955c88db8b249681cd78a76c10163bb0ba (diff) | |
download | op-kernel-dev-73b1c90d3650a81ff9997f6d1ddfda6efb9fac09.zip op-kernel-dev-73b1c90d3650a81ff9997f6d1ddfda6efb9fac09.tar.gz |
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: Saurabh Sengar <saurabh.truth@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r-- | drivers/net/ethernet/freescale/fec_main.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index b2a3220..d2328fc 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -3277,7 +3277,6 @@ static void fec_enet_get_queue_num(struct platform_device *pdev, int *num_tx, int *num_rx) { struct device_node *np = pdev->dev.of_node; - int err; *num_tx = *num_rx = 1; @@ -3285,13 +3284,9 @@ fec_enet_get_queue_num(struct platform_device *pdev, int *num_tx, int *num_rx) return; /* parse the num of tx and rx queues */ - err = of_property_read_u32(np, "fsl,num-tx-queues", num_tx); - if (err) - *num_tx = 1; + of_property_read_u32(np, "fsl,num-tx-queues", num_tx); - err = of_property_read_u32(np, "fsl,num-rx-queues", num_rx); - if (err) - *num_rx = 1; + of_property_read_u32(np, "fsl,num-rx-queues", num_rx); if (*num_tx < 1 || *num_tx > FEC_ENET_MAX_TX_QS) { dev_warn(&pdev->dev, "Invalid num_tx(=%d), fall back to 1\n", |