aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/misc/eeprom/at24.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/misc/eeprom/at24.c b/drivers/misc/eeprom/at24.c
index e0b4b36ef010..783244b485cc 100644
--- a/drivers/misc/eeprom/at24.c
+++ b/drivers/misc/eeprom/at24.c
@@ -730,6 +730,16 @@ static int at24_probe(struct i2c_client *client, const struct i2c_device_id *id)
730 dev_warn(&client->dev, 730 dev_warn(&client->dev,
731 "page_size looks suspicious (no power of 2)!\n"); 731 "page_size looks suspicious (no power of 2)!\n");
732 732
733 /*
734 * REVISIT: the size of the EUI-48 byte array is 6 in at24mac402, while
735 * the call to ilog2() in AT24_DEVICE_MAGIC() rounds it down to 4.
736 *
737 * Eventually we'll get rid of the magic values altoghether in favor of
738 * real structs, but for now just manually set the right size.
739 */
740 if (chip.flags & AT24_FLAG_MAC && chip.byte_len == 4)
741 chip.byte_len = 6;
742
733 /* Use I2C operations unless we're stuck with SMBus extensions. */ 743 /* Use I2C operations unless we're stuck with SMBus extensions. */
734 if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { 744 if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) {
735 if (chip.flags & AT24_FLAG_ADDR16) 745 if (chip.flags & AT24_FLAG_ADDR16)