mirror of https://gitee.com/openkylin/linux.git
rtl8xxxu: rtl8192eu_parse_efuse(): Use a pointer to the struct rtl8192eu_efuse
Make the code easier to read and less error prone by using a pointer to the efuse. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
This commit is contained in:
parent
4959444165
commit
b7dda34d1e
|
@ -2288,33 +2288,27 @@ static int rtl8192cu_parse_efuse(struct rtl8xxxu_priv *priv)
|
|||
|
||||
static int rtl8192eu_parse_efuse(struct rtl8xxxu_priv *priv)
|
||||
{
|
||||
struct rtl8192eu_efuse *efuse = &priv->efuse_wifi.efuse8192eu;
|
||||
int i;
|
||||
|
||||
if (priv->efuse_wifi.efuse8192eu.rtl_id != cpu_to_le16(0x8129))
|
||||
if (efuse->rtl_id != cpu_to_le16(0x8129))
|
||||
return -EINVAL;
|
||||
|
||||
ether_addr_copy(priv->mac_addr, priv->efuse_wifi.efuse8192eu.mac_addr);
|
||||
ether_addr_copy(priv->mac_addr, efuse->mac_addr);
|
||||
|
||||
memcpy(priv->cck_tx_power_index_A,
|
||||
priv->efuse_wifi.efuse8192eu.cck_tx_power_index_A,
|
||||
memcpy(priv->cck_tx_power_index_A, efuse->cck_tx_power_index_A,
|
||||
sizeof(priv->cck_tx_power_index_A));
|
||||
memcpy(priv->cck_tx_power_index_B,
|
||||
priv->efuse_wifi.efuse8192eu.cck_tx_power_index_B,
|
||||
memcpy(priv->cck_tx_power_index_B, efuse->cck_tx_power_index_B,
|
||||
sizeof(priv->cck_tx_power_index_B));
|
||||
|
||||
memcpy(priv->ht40_1s_tx_power_index_A,
|
||||
priv->efuse_wifi.efuse8192eu.ht40_1s_tx_power_index_A,
|
||||
memcpy(priv->ht40_1s_tx_power_index_A, efuse->ht40_1s_tx_power_index_A,
|
||||
sizeof(priv->ht40_1s_tx_power_index_A));
|
||||
memcpy(priv->ht40_1s_tx_power_index_B,
|
||||
priv->efuse_wifi.efuse8192eu.ht40_1s_tx_power_index_B,
|
||||
memcpy(priv->ht40_1s_tx_power_index_B, efuse->ht40_1s_tx_power_index_B,
|
||||
sizeof(priv->ht40_1s_tx_power_index_B));
|
||||
|
||||
dev_info(&priv->udev->dev, "Vendor: %.7s\n",
|
||||
priv->efuse_wifi.efuse8192eu.vendor_name);
|
||||
dev_info(&priv->udev->dev, "Product: %.11s\n",
|
||||
priv->efuse_wifi.efuse8192eu.device_name);
|
||||
dev_info(&priv->udev->dev, "Serial: %.11s\n",
|
||||
priv->efuse_wifi.efuse8192eu.serial);
|
||||
dev_info(&priv->udev->dev, "Vendor: %.7s\n", efuse->vendor_name);
|
||||
dev_info(&priv->udev->dev, "Product: %.11s\n", efuse->device_name);
|
||||
dev_info(&priv->udev->dev, "Serial: %.11s\n", efuse->serial);
|
||||
|
||||
if (rtl8xxxu_debug & RTL8XXXU_DEBUG_EFUSE) {
|
||||
unsigned char *raw = priv->efuse_wifi.raw;
|
||||
|
|
Loading…
Reference in New Issue