[PATCH V2] staging: sbe-2t3e3: use -ve error return codes in dc_init_descriptor_list

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



the dc_init_descriptor_list actually returns a +ve error return codes,
which is abnormal as other functions in kernel return -ve error codes on
failure. so replace the return codes of this function with -ve values
to make the consistency with the other functions in kernel

Signed-off-by: Devendra Naga <devendra.aaru@xxxxxxxxx>
---
 v2: fix the subject line
 drivers/staging/sbe-2t3e3/dc.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/sbe-2t3e3/dc.c b/drivers/staging/sbe-2t3e3/dc.c
index 9e81d90..51079f2 100644
--- a/drivers/staging/sbe-2t3e3/dc.c
+++ b/drivers/staging/sbe-2t3e3/dc.c
@@ -317,7 +317,7 @@ u32 dc_init_descriptor_list(struct channel *sc)
 					    sizeof(t3e3_rx_desc_t), GFP_KERNEL);
 	if (sc->ether.rx_ring == NULL) {
 		dev_err(&sc->pdev->dev, "SBE 2T3E3: no buffer space for RX ring\n");
-		return ENOMEM;
+		return -ENOMEM;
 	}
 
 	if (sc->ether.tx_ring == NULL)
@@ -327,7 +327,7 @@ u32 dc_init_descriptor_list(struct channel *sc)
 		kfree(sc->ether.rx_ring);
 		sc->ether.rx_ring = NULL;
 		dev_err(&sc->pdev->dev, "SBE 2T3E3: no buffer space for RX ring\n");
-		return ENOMEM;
+		return -ENOMEM;
 	}
 
 
@@ -351,7 +351,7 @@ u32 dc_init_descriptor_list(struct channel *sc)
 				sc->ether.tx_ring = NULL;
 				dev_err(&sc->pdev->dev, "SBE 2T3E3: token_alloc err:"
 					" no buffer space for RX ring\n");
-				return ENOBUFS;
+				return -ENOBUFS;
 			}
 			sc->ether.rx_data[i] = m;
 		}
-- 
1.7.1

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux