Skip to content

Commit 73c86ee

Browse files
hkallweitdavem330
authored andcommitted
r8169: change type of argument in rtl_disable/enable_clock_request
Changing the argument type to struct rtl8169_private * is more in line with the other functions in the driver and it allows to reduce the code size. Signed-off-by: Heiner Kallweit <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent cb73200 commit 73c86ee

File tree

1 file changed

+11
-22
lines changed
  • drivers/net/ethernet/realtek

1 file changed

+11
-22
lines changed

drivers/net/ethernet/realtek/r8169.c

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5685,15 +5685,15 @@ static void rtl_ephy_init(struct rtl8169_private *tp, const struct ephy_info *e,
56855685
}
56865686
}
56875687

5688-
static void rtl_disable_clock_request(struct pci_dev *pdev)
5688+
static void rtl_disable_clock_request(struct rtl8169_private *tp)
56895689
{
5690-
pcie_capability_clear_word(pdev, PCI_EXP_LNKCTL,
5690+
pcie_capability_clear_word(tp->pci_dev, PCI_EXP_LNKCTL,
56915691
PCI_EXP_LNKCTL_CLKREQ_EN);
56925692
}
56935693

5694-
static void rtl_enable_clock_request(struct pci_dev *pdev)
5694+
static void rtl_enable_clock_request(struct rtl8169_private *tp)
56955695
{
5696-
pcie_capability_set_word(pdev, PCI_EXP_LNKCTL,
5696+
pcie_capability_set_word(tp->pci_dev, PCI_EXP_LNKCTL,
56975697
PCI_EXP_LNKCTL_CLKREQ_EN);
56985698
}
56995699

@@ -5745,16 +5745,14 @@ static void rtl_hw_start_8168bef(struct rtl8169_private *tp)
57455745

57465746
static void __rtl_hw_start_8168cp(struct rtl8169_private *tp)
57475747
{
5748-
struct pci_dev *pdev = tp->pci_dev;
5749-
57505748
RTL_W8(tp, Config1, RTL_R8(tp, Config1) | Speed_down);
57515749

57525750
RTL_W8(tp, Config3, RTL_R8(tp, Config3) & ~Beacon_en);
57535751

57545752
if (tp->dev->mtu <= ETH_DATA_LEN)
57555753
rtl_tx_performance_tweak(tp, 0x5 << MAX_READ_REQUEST_SHIFT);
57565754

5757-
rtl_disable_clock_request(pdev);
5755+
rtl_disable_clock_request(tp);
57585756

57595757
RTL_W16(tp, CPlusCmd, RTL_R16(tp, CPlusCmd) & ~R8168_CPCMD_QUIRK_MASK);
57605758
}
@@ -5850,11 +5848,9 @@ static void rtl_hw_start_8168c_4(struct rtl8169_private *tp)
58505848

58515849
static void rtl_hw_start_8168d(struct rtl8169_private *tp)
58525850
{
5853-
struct pci_dev *pdev = tp->pci_dev;
5854-
58555851
rtl_csi_access_enable_2(tp);
58565852

5857-
rtl_disable_clock_request(pdev);
5853+
rtl_disable_clock_request(tp);
58585854

58595855
RTL_W8(tp, MaxTxPacketSize, TxPacketMax);
58605856

@@ -5866,21 +5862,18 @@ static void rtl_hw_start_8168d(struct rtl8169_private *tp)
58665862

58675863
static void rtl_hw_start_8168dp(struct rtl8169_private *tp)
58685864
{
5869-
struct pci_dev *pdev = tp->pci_dev;
5870-
58715865
rtl_csi_access_enable_1(tp);
58725866

58735867
if (tp->dev->mtu <= ETH_DATA_LEN)
58745868
rtl_tx_performance_tweak(tp, 0x5 << MAX_READ_REQUEST_SHIFT);
58755869

58765870
RTL_W8(tp, MaxTxPacketSize, TxPacketMax);
58775871

5878-
rtl_disable_clock_request(pdev);
5872+
rtl_disable_clock_request(tp);
58795873
}
58805874

58815875
static void rtl_hw_start_8168d_4(struct rtl8169_private *tp)
58825876
{
5883-
struct pci_dev *pdev = tp->pci_dev;
58845877
static const struct ephy_info e_info_8168d_4[] = {
58855878
{ 0x0b, 0x0000, 0x0048 },
58865879
{ 0x19, 0x0020, 0x0050 },
@@ -5895,12 +5888,11 @@ static void rtl_hw_start_8168d_4(struct rtl8169_private *tp)
58955888

58965889
rtl_ephy_init(tp, e_info_8168d_4, ARRAY_SIZE(e_info_8168d_4));
58975890

5898-
rtl_enable_clock_request(pdev);
5891+
rtl_enable_clock_request(tp);
58995892
}
59005893

59015894
static void rtl_hw_start_8168e_1(struct rtl8169_private *tp)
59025895
{
5903-
struct pci_dev *pdev = tp->pci_dev;
59045896
static const struct ephy_info e_info_8168e_1[] = {
59055897
{ 0x00, 0x0200, 0x0100 },
59065898
{ 0x00, 0x0000, 0x0004 },
@@ -5926,7 +5918,7 @@ static void rtl_hw_start_8168e_1(struct rtl8169_private *tp)
59265918

59275919
RTL_W8(tp, MaxTxPacketSize, TxPacketMax);
59285920

5929-
rtl_disable_clock_request(pdev);
5921+
rtl_disable_clock_request(tp);
59305922

59315923
/* Reset tx FIFO pointer */
59325924
RTL_W32(tp, MISC, RTL_R32(tp, MISC) | TXPLA_RST);
@@ -5937,7 +5929,6 @@ static void rtl_hw_start_8168e_1(struct rtl8169_private *tp)
59375929

59385930
static void rtl_hw_start_8168e_2(struct rtl8169_private *tp)
59395931
{
5940-
struct pci_dev *pdev = tp->pci_dev;
59415932
static const struct ephy_info e_info_8168e_2[] = {
59425933
{ 0x09, 0x0000, 0x0080 },
59435934
{ 0x19, 0x0000, 0x0224 }
@@ -5961,7 +5952,7 @@ static void rtl_hw_start_8168e_2(struct rtl8169_private *tp)
59615952

59625953
RTL_W8(tp, MaxTxPacketSize, EarlySize);
59635954

5964-
rtl_disable_clock_request(pdev);
5955+
rtl_disable_clock_request(tp);
59655956

59665957
RTL_W32(tp, TxConfig, RTL_R32(tp, TxConfig) | TXCFG_AUTO_FIFO);
59675958
RTL_W8(tp, MCU, RTL_R8(tp, MCU) & ~NOW_IS_OOB);
@@ -5976,8 +5967,6 @@ static void rtl_hw_start_8168e_2(struct rtl8169_private *tp)
59765967

59775968
static void rtl_hw_start_8168f(struct rtl8169_private *tp)
59785969
{
5979-
struct pci_dev *pdev = tp->pci_dev;
5980-
59815970
rtl_csi_access_enable_2(tp);
59825971

59835972
rtl_tx_performance_tweak(tp, 0x5 << MAX_READ_REQUEST_SHIFT);
@@ -5995,7 +5984,7 @@ static void rtl_hw_start_8168f(struct rtl8169_private *tp)
59955984

59965985
RTL_W8(tp, MaxTxPacketSize, EarlySize);
59975986

5998-
rtl_disable_clock_request(pdev);
5987+
rtl_disable_clock_request(tp);
59995988

60005989
RTL_W32(tp, TxConfig, RTL_R32(tp, TxConfig) | TXCFG_AUTO_FIFO);
60015990
RTL_W8(tp, MCU, RTL_R8(tp, MCU) & ~NOW_IS_OOB);

0 commit comments

Comments
 (0)