Skip to content

Commit 507605a

Browse files
hayesorzdavem330
authored andcommitted
r8152: split rtl8152_enable
Split the contents of rtl8152_enable() into rtl_set_eee_plus() and rtl_enable(). Signed-off-by: Hayes Wang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent c81229c commit 507605a

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

drivers/net/usb/r8152.c

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1447,13 +1447,11 @@ static inline u8 rtl8152_get_speed(struct r8152 *tp)
14471447
return ocp_read_byte(tp, MCU_TYPE_PLA, PLA_PHYSTATUS);
14481448
}
14491449

1450-
static int rtl8152_enable(struct r8152 *tp)
1450+
static void rtl_set_eee_plus(struct r8152 *tp)
14511451
{
14521452
u32 ocp_data;
1453-
int i, ret;
14541453
u8 speed;
14551454

1456-
set_tx_qlen(tp);
14571455
speed = rtl8152_get_speed(tp);
14581456
if (speed & _10bps) {
14591457
ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_EEEP_CR);
@@ -1464,6 +1462,12 @@ static int rtl8152_enable(struct r8152 *tp)
14641462
ocp_data &= ~EEEP_CR_EEEP_TX;
14651463
ocp_write_word(tp, MCU_TYPE_PLA, PLA_EEEP_CR, ocp_data);
14661464
}
1465+
}
1466+
1467+
static int rtl_enable(struct r8152 *tp)
1468+
{
1469+
u32 ocp_data;
1470+
int i, ret;
14671471

14681472
r8152b_reset_packet_filter(tp);
14691473

@@ -1485,6 +1489,14 @@ static int rtl8152_enable(struct r8152 *tp)
14851489
return ret;
14861490
}
14871491

1492+
static int rtl8152_enable(struct r8152 *tp)
1493+
{
1494+
set_tx_qlen(tp);
1495+
rtl_set_eee_plus(tp);
1496+
1497+
return rtl_enable(tp);
1498+
}
1499+
14881500
static void rtl8152_disable(struct r8152 *tp)
14891501
{
14901502
struct net_device_stats *stats = rtl8152_get_stats(tp->netdev);

0 commit comments

Comments
 (0)