aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDevendra Naga <devendra.aaru@gmail.com>2012-09-19 05:16:08 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-09-21 11:57:56 -0400
commita00979cccb9cc9727b8357f8fdf1c1924c9b73ef (patch)
treecc6c848ae195b599b9bc3489599792aa76f0c38f
parentbae95b09076abeecd193a8efbc34c00f4309d3f6 (diff)
staging: sbe-2t3e3: use -ve error return codes in dc_init_descriptor_list
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. Also make the dc_init_descriptor_list static as its never called anywhere except in this file and move the function prototype from the headerfile into the c file as its referred only in this c file. Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/sbe-2t3e3/2t3e3.h1
-rw-r--r--drivers/staging/sbe-2t3e3/dc.c10
2 files changed, 6 insertions, 5 deletions
diff --git a/drivers/staging/sbe-2t3e3/2t3e3.h b/drivers/staging/sbe-2t3e3/2t3e3.h
index 383f2cfc1ad2..ccad049c1122 100644
--- a/drivers/staging/sbe-2t3e3/2t3e3.h
+++ b/drivers/staging/sbe-2t3e3/2t3e3.h
@@ -789,7 +789,6 @@ void dc_restart(struct channel *);
789void dc_receiver_onoff(struct channel *, u32); 789void dc_receiver_onoff(struct channel *, u32);
790void dc_transmitter_onoff(struct channel *, u32); 790void dc_transmitter_onoff(struct channel *, u32);
791void dc_set_loopback(struct channel *, u32); 791void dc_set_loopback(struct channel *, u32);
792u32 dc_init_descriptor_list(struct channel *);
793void dc_clear_descriptor_list(struct channel *); 792void dc_clear_descriptor_list(struct channel *);
794void dc_drop_descriptor_list(struct channel *); 793void dc_drop_descriptor_list(struct channel *);
795void dc_set_output_port(struct channel *); 794void dc_set_output_port(struct channel *);
diff --git a/drivers/staging/sbe-2t3e3/dc.c b/drivers/staging/sbe-2t3e3/dc.c
index 9e81d9036a33..daadd6ea4978 100644
--- a/drivers/staging/sbe-2t3e3/dc.c
+++ b/drivers/staging/sbe-2t3e3/dc.c
@@ -17,6 +17,8 @@
17#include "2t3e3.h" 17#include "2t3e3.h"
18#include "ctrl.h" 18#include "ctrl.h"
19 19
20static int dc_init_descriptor_list(struct channel *sc);
21
20void dc_init(struct channel *sc) 22void dc_init(struct channel *sc)
21{ 23{
22 u32 val; 24 u32 val;
@@ -307,7 +309,7 @@ void dc_set_loopback(struct channel *sc, u32 mode)
307 SBE_2T3E3_21143_VAL_FULL_DUPLEX_MODE); 309 SBE_2T3E3_21143_VAL_FULL_DUPLEX_MODE);
308} 310}
309 311
310u32 dc_init_descriptor_list(struct channel *sc) 312static int dc_init_descriptor_list(struct channel *sc)
311{ 313{
312 u32 i, j; 314 u32 i, j;
313 struct sk_buff *m; 315 struct sk_buff *m;
@@ -317,7 +319,7 @@ u32 dc_init_descriptor_list(struct channel *sc)
317 sizeof(t3e3_rx_desc_t), GFP_KERNEL); 319 sizeof(t3e3_rx_desc_t), GFP_KERNEL);
318 if (sc->ether.rx_ring == NULL) { 320 if (sc->ether.rx_ring == NULL) {
319 dev_err(&sc->pdev->dev, "SBE 2T3E3: no buffer space for RX ring\n"); 321 dev_err(&sc->pdev->dev, "SBE 2T3E3: no buffer space for RX ring\n");
320 return ENOMEM; 322 return -ENOMEM;
321 } 323 }
322 324
323 if (sc->ether.tx_ring == NULL) 325 if (sc->ether.tx_ring == NULL)
@@ -327,7 +329,7 @@ u32 dc_init_descriptor_list(struct channel *sc)
327 kfree(sc->ether.rx_ring); 329 kfree(sc->ether.rx_ring);
328 sc->ether.rx_ring = NULL; 330 sc->ether.rx_ring = NULL;
329 dev_err(&sc->pdev->dev, "SBE 2T3E3: no buffer space for RX ring\n"); 331 dev_err(&sc->pdev->dev, "SBE 2T3E3: no buffer space for RX ring\n");
330 return ENOMEM; 332 return -ENOMEM;
331 } 333 }
332 334
333 335
@@ -351,7 +353,7 @@ u32 dc_init_descriptor_list(struct channel *sc)
351 sc->ether.tx_ring = NULL; 353 sc->ether.tx_ring = NULL;
352 dev_err(&sc->pdev->dev, "SBE 2T3E3: token_alloc err:" 354 dev_err(&sc->pdev->dev, "SBE 2T3E3: token_alloc err:"
353 " no buffer space for RX ring\n"); 355 " no buffer space for RX ring\n");
354 return ENOBUFS; 356 return -ENOBUFS;
355 } 357 }
356 sc->ether.rx_data[i] = m; 358 sc->ether.rx_data[i] = m;
357 } 359 }