Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

rtl8xxxu: Use a struct rtl8xxxu_fileops * in rtl8xxxu_init_device()

This saves some 217, or about, derefences of priv->fops.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>

authored by

Jes Sorensen and committed by
Kalle Valo
2fc5dd27 c0a99bbb

+19 -18
+19 -18
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
··· 3886 3886 { 3887 3887 struct rtl8xxxu_priv *priv = hw->priv; 3888 3888 struct device *dev = &priv->udev->dev; 3889 + struct rtl8xxxu_fileops *fops = priv->fops; 3889 3890 bool macpower; 3890 3891 int ret; 3891 3892 u8 val8; ··· 3905 3904 else 3906 3905 macpower = true; 3907 3906 3908 - ret = priv->fops->power_on(priv); 3907 + ret = fops->power_on(priv); 3909 3908 if (ret < 0) { 3910 3909 dev_warn(dev, "%s: Failed power on\n", __func__); 3911 3910 goto exit; ··· 3922 3921 /* 3923 3922 * Set RX page boundary 3924 3923 */ 3925 - rtl8xxxu_write16(priv, REG_TRXFF_BNDY + 2, priv->fops->trxff_boundary); 3924 + rtl8xxxu_write16(priv, REG_TRXFF_BNDY + 2, fops->trxff_boundary); 3926 3925 3927 3926 ret = rtl8xxxu_download_firmware(priv); 3928 3927 dev_dbg(dev, "%s: download_firmware %i\n", __func__, ret); ··· 3933 3932 if (ret) 3934 3933 goto exit; 3935 3934 3936 - if (priv->fops->phy_init_antenna_selection) 3937 - priv->fops->phy_init_antenna_selection(priv); 3935 + if (fops->phy_init_antenna_selection) 3936 + fops->phy_init_antenna_selection(priv); 3938 3937 3939 3938 ret = rtl8xxxu_init_mac(priv); 3940 3939 ··· 3947 3946 if (ret) 3948 3947 goto exit; 3949 3948 3950 - ret = priv->fops->init_phy_rf(priv); 3949 + ret = fops->init_phy_rf(priv); 3951 3950 if (ret) 3952 3951 goto exit; 3953 3952 ··· 3972 3971 /* 3973 3972 * Set TX buffer boundary 3974 3973 */ 3975 - val8 = priv->fops->total_page_num + 1; 3974 + val8 = fops->total_page_num + 1; 3976 3975 3977 3976 rtl8xxxu_write8(priv, REG_TXPKTBUF_BCNQ_BDNY, val8); 3978 3977 rtl8xxxu_write8(priv, REG_TXPKTBUF_MGQ_BDNY, val8); ··· 3985 3984 * The vendor drivers set PBP for all devices, except 8192e. 3986 3985 * There is no explanation for this in any of the sources. 3987 3986 */ 3988 - val8 = (priv->fops->pbp_rx << PBP_PAGE_SIZE_RX_SHIFT) | 3989 - (priv->fops->pbp_tx << PBP_PAGE_SIZE_TX_SHIFT); 3987 + val8 = (fops->pbp_rx << PBP_PAGE_SIZE_RX_SHIFT) | 3988 + (fops->pbp_tx << PBP_PAGE_SIZE_TX_SHIFT); 3990 3989 if (priv->rtl_chip != RTL8192E) 3991 3990 rtl8xxxu_write8(priv, REG_PBP, val8); 3992 3991 3993 3992 dev_dbg(dev, "%s: macpower %i\n", __func__, macpower); 3994 3993 if (!macpower) { 3995 - ret = priv->fops->llt_init(priv); 3994 + ret = fops->llt_init(priv); 3996 3995 if (ret) { 3997 3996 dev_warn(dev, "%s: LLT table init failed\n", __func__); 3998 3997 goto exit; ··· 4001 4000 /* 4002 4001 * Chip specific quirks 4003 4002 */ 4004 - priv->fops->usb_quirks(priv); 4003 + fops->usb_quirks(priv); 4005 4004 4006 4005 /* 4007 4006 * Enable TX report and TX report timer for 8723bu/8188eu/... 4008 4007 */ 4009 - if (priv->fops->has_tx_report) { 4008 + if (fops->has_tx_report) { 4010 4009 val8 = rtl8xxxu_read8(priv, REG_TX_REPORT_CTRL); 4011 4010 val8 |= TX_REPORT_CTRL_TIMER_ENABLE; 4012 4011 rtl8xxxu_write8(priv, REG_TX_REPORT_CTRL, val8); ··· 4141 4140 rtl8xxxu_write8(priv, REG_RSV_CTRL, val8); 4142 4141 } 4143 4142 4144 - if (priv->fops->init_aggregation) 4145 - priv->fops->init_aggregation(priv); 4143 + if (fops->init_aggregation) 4144 + fops->init_aggregation(priv); 4146 4145 4147 4146 /* 4148 4147 * Enable CCK and OFDM block ··· 4159 4158 /* 4160 4159 * Start out with default power levels for channel 6, 20MHz 4161 4160 */ 4162 - priv->fops->set_tx_power(priv, 1, false); 4161 + fops->set_tx_power(priv, 1, false); 4163 4162 4164 4163 /* Let the 8051 take control of antenna setting */ 4165 4164 if (priv->rtl_chip != RTL8192E) { ··· 4175 4174 4176 4175 rtl8xxxu_write16(priv, REG_FAST_EDCA_CTRL, 0); 4177 4176 4178 - if (priv->fops->init_statistics) 4179 - priv->fops->init_statistics(priv); 4177 + if (fops->init_statistics) 4178 + fops->init_statistics(priv); 4180 4179 4181 4180 if (priv->rtl_chip == RTL8192E) { 4182 4181 /* ··· 4194 4193 4195 4194 rtl8723a_phy_lc_calibrate(priv); 4196 4195 4197 - priv->fops->phy_iq_calibrate(priv); 4196 + fops->phy_iq_calibrate(priv); 4198 4197 4199 4198 /* 4200 4199 * This should enable thermal meter 4201 4200 */ 4202 - if (priv->fops->gen2_thermal_meter) 4201 + if (fops->gen2_thermal_meter) 4203 4202 rtl8xxxu_write_rfreg(priv, 4204 4203 RF_A, RF6052_REG_T_METER_8723B, 0x37cf8); 4205 4204 else