Skip to content

Commit

Permalink
mt76x2: remove unnecessary len variable in mt76x2_eeprom_load()
Browse files Browse the repository at this point in the history
Substitute unnecessary len variable in mt76x2_eeprom_load() with
MT7662_EEPROM_SIZE macro since len is used just to store eeprom
default size.

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
  • Loading branch information
Lorenzo Bianconi authored and Kalle Valo committed Mar 13, 2018
1 parent 3fb2f6a commit fbae9c7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions drivers/net/wireless/mediatek/mt76/mt76x2_eeprom.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,34 +222,34 @@ static int
mt76x2_eeprom_load(struct mt76x2_dev *dev)
{
void *efuse;
int len = MT7662_EEPROM_SIZE;
bool found;
int ret;

ret = mt76_eeprom_init(&dev->mt76, len);
ret = mt76_eeprom_init(&dev->mt76, MT7662_EEPROM_SIZE);
if (ret < 0)
return ret;

found = ret;
if (found)
found = !mt76x2_check_eeprom(dev);

dev->mt76.otp.data = devm_kzalloc(dev->mt76.dev, len, GFP_KERNEL);
dev->mt76.otp.size = len;
dev->mt76.otp.data = devm_kzalloc(dev->mt76.dev, MT7662_EEPROM_SIZE,
GFP_KERNEL);
dev->mt76.otp.size = MT7662_EEPROM_SIZE;
if (!dev->mt76.otp.data)
return -ENOMEM;

efuse = dev->mt76.otp.data;

if (mt76x2_get_efuse_data(dev, efuse, len))
if (mt76x2_get_efuse_data(dev, efuse, MT7662_EEPROM_SIZE))
goto out;

if (found) {
mt76x2_apply_cal_free_data(dev, efuse);
} else {
/* FIXME: check if efuse data is complete */
found = true;
memcpy(dev->mt76.eeprom.data, efuse, len);
memcpy(dev->mt76.eeprom.data, efuse, MT7662_EEPROM_SIZE);
}

out:
Expand Down

0 comments on commit fbae9c7

Please sign in to comment.