Commit fbae9c74 authored by Lorenzo Bianconi's avatar Lorenzo Bianconi Committed by Kalle Valo

mt76x2: remove unnecessary len variable in mt76x2_eeprom_load()

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: default avatarLorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 3fb2f6a4
...@@ -222,11 +222,10 @@ static int ...@@ -222,11 +222,10 @@ static int
mt76x2_eeprom_load(struct mt76x2_dev *dev) mt76x2_eeprom_load(struct mt76x2_dev *dev)
{ {
void *efuse; void *efuse;
int len = MT7662_EEPROM_SIZE;
bool found; bool found;
int ret; int ret;
ret = mt76_eeprom_init(&dev->mt76, len); ret = mt76_eeprom_init(&dev->mt76, MT7662_EEPROM_SIZE);
if (ret < 0) if (ret < 0)
return ret; return ret;
...@@ -234,14 +233,15 @@ mt76x2_eeprom_load(struct mt76x2_dev *dev) ...@@ -234,14 +233,15 @@ mt76x2_eeprom_load(struct mt76x2_dev *dev)
if (found) if (found)
found = !mt76x2_check_eeprom(dev); found = !mt76x2_check_eeprom(dev);
dev->mt76.otp.data = devm_kzalloc(dev->mt76.dev, len, GFP_KERNEL); dev->mt76.otp.data = devm_kzalloc(dev->mt76.dev, MT7662_EEPROM_SIZE,
dev->mt76.otp.size = len; GFP_KERNEL);
dev->mt76.otp.size = MT7662_EEPROM_SIZE;
if (!dev->mt76.otp.data) if (!dev->mt76.otp.data)
return -ENOMEM; return -ENOMEM;
efuse = dev->mt76.otp.data; 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; goto out;
if (found) { if (found) {
...@@ -249,7 +249,7 @@ mt76x2_eeprom_load(struct mt76x2_dev *dev) ...@@ -249,7 +249,7 @@ mt76x2_eeprom_load(struct mt76x2_dev *dev)
} else { } else {
/* FIXME: check if efuse data is complete */ /* FIXME: check if efuse data is complete */
found = true; found = true;
memcpy(dev->mt76.eeprom.data, efuse, len); memcpy(dev->mt76.eeprom.data, efuse, MT7662_EEPROM_SIZE);
} }
out: out:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment