@@ -485,12 +485,12 @@ static int mv88e6xxx_serdes_pcs_get_state(struct dsa_switch *ds, int port,
485
485
struct phylink_link_state * state )
486
486
{
487
487
struct mv88e6xxx_chip * chip = ds -> priv ;
488
- u8 lane ;
488
+ int lane ;
489
489
int err ;
490
490
491
491
mv88e6xxx_reg_lock (chip );
492
492
lane = mv88e6xxx_serdes_get_lane (chip , port );
493
- if (lane && chip -> info -> ops -> serdes_pcs_get_state )
493
+ if (lane >= 0 && chip -> info -> ops -> serdes_pcs_get_state )
494
494
err = chip -> info -> ops -> serdes_pcs_get_state (chip , port , lane ,
495
495
state );
496
496
else
@@ -506,11 +506,11 @@ static int mv88e6xxx_serdes_pcs_config(struct mv88e6xxx_chip *chip, int port,
506
506
const unsigned long * advertise )
507
507
{
508
508
const struct mv88e6xxx_ops * ops = chip -> info -> ops ;
509
- u8 lane ;
509
+ int lane ;
510
510
511
511
if (ops -> serdes_pcs_config ) {
512
512
lane = mv88e6xxx_serdes_get_lane (chip , port );
513
- if (lane )
513
+ if (lane >= 0 )
514
514
return ops -> serdes_pcs_config (chip , port , lane , mode ,
515
515
interface , advertise );
516
516
}
@@ -523,14 +523,14 @@ static void mv88e6xxx_serdes_pcs_an_restart(struct dsa_switch *ds, int port)
523
523
struct mv88e6xxx_chip * chip = ds -> priv ;
524
524
const struct mv88e6xxx_ops * ops ;
525
525
int err = 0 ;
526
- u8 lane ;
526
+ int lane ;
527
527
528
528
ops = chip -> info -> ops ;
529
529
530
530
if (ops -> serdes_pcs_an_restart ) {
531
531
mv88e6xxx_reg_lock (chip );
532
532
lane = mv88e6xxx_serdes_get_lane (chip , port );
533
- if (lane )
533
+ if (lane >= 0 )
534
534
err = ops -> serdes_pcs_an_restart (chip , port , lane );
535
535
mv88e6xxx_reg_unlock (chip );
536
536
@@ -544,11 +544,11 @@ static int mv88e6xxx_serdes_pcs_link_up(struct mv88e6xxx_chip *chip, int port,
544
544
int speed , int duplex )
545
545
{
546
546
const struct mv88e6xxx_ops * ops = chip -> info -> ops ;
547
- u8 lane ;
547
+ int lane ;
548
548
549
549
if (!phylink_autoneg_inband (mode ) && ops -> serdes_pcs_link_up ) {
550
550
lane = mv88e6xxx_serdes_get_lane (chip , port );
551
- if (lane )
551
+ if (lane >= 0 )
552
552
return ops -> serdes_pcs_link_up (chip , port , lane ,
553
553
speed , duplex );
554
554
}
@@ -2460,19 +2460,19 @@ static irqreturn_t mv88e6xxx_serdes_irq_thread_fn(int irq, void *dev_id)
2460
2460
struct mv88e6xxx_chip * chip = mvp -> chip ;
2461
2461
irqreturn_t ret = IRQ_NONE ;
2462
2462
int port = mvp -> port ;
2463
- u8 lane ;
2463
+ int lane ;
2464
2464
2465
2465
mv88e6xxx_reg_lock (chip );
2466
2466
lane = mv88e6xxx_serdes_get_lane (chip , port );
2467
- if (lane )
2467
+ if (lane >= 0 )
2468
2468
ret = mv88e6xxx_serdes_irq_status (chip , port , lane );
2469
2469
mv88e6xxx_reg_unlock (chip );
2470
2470
2471
2471
return ret ;
2472
2472
}
2473
2473
2474
2474
static int mv88e6xxx_serdes_irq_request (struct mv88e6xxx_chip * chip , int port ,
2475
- u8 lane )
2475
+ int lane )
2476
2476
{
2477
2477
struct mv88e6xxx_port * dev_id = & chip -> ports [port ];
2478
2478
unsigned int irq ;
@@ -2501,7 +2501,7 @@ static int mv88e6xxx_serdes_irq_request(struct mv88e6xxx_chip *chip, int port,
2501
2501
}
2502
2502
2503
2503
static int mv88e6xxx_serdes_irq_free (struct mv88e6xxx_chip * chip , int port ,
2504
- u8 lane )
2504
+ int lane )
2505
2505
{
2506
2506
struct mv88e6xxx_port * dev_id = & chip -> ports [port ];
2507
2507
unsigned int irq = dev_id -> serdes_irq ;
@@ -2526,11 +2526,11 @@ static int mv88e6xxx_serdes_irq_free(struct mv88e6xxx_chip *chip, int port,
2526
2526
static int mv88e6xxx_serdes_power (struct mv88e6xxx_chip * chip , int port ,
2527
2527
bool on )
2528
2528
{
2529
- u8 lane ;
2529
+ int lane ;
2530
2530
int err ;
2531
2531
2532
2532
lane = mv88e6xxx_serdes_get_lane (chip , port );
2533
- if (! lane )
2533
+ if (lane < 0 )
2534
2534
return 0 ;
2535
2535
2536
2536
if (on ) {
0 commit comments