|
| 1 | +From f1250392a9dff619b147d8aee0c73c0f6d550713 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Prince George < [email protected]> |
| 3 | +Date: Thu, 13 Jun 2024 14:18:22 +0000 |
| 4 | +Subject: [PATCH] Fix optoe's write_max when using native i2c driver |
| 5 | + |
| 6 | +Signed-off-by: Prince George < [email protected]> |
| 7 | +--- |
| 8 | + drivers/misc/eeprom/optoe.c | 4 ++-- |
| 9 | + 1 file changed, 2 insertions(+), 2 deletions(-) |
| 10 | + |
| 11 | +diff --git a/drivers/misc/eeprom/optoe.c b/drivers/misc/eeprom/optoe.c |
| 12 | +index 5a2e71be5..1efd18040 100644 |
| 13 | +--- a/drivers/misc/eeprom/optoe.c |
| 14 | ++++ b/drivers/misc/eeprom/optoe.c |
| 15 | +@@ -1114,7 +1114,7 @@ static int optoe_probe(struct i2c_client *client, |
| 16 | + goto exit; |
| 17 | + } |
| 18 | + |
| 19 | +- dev_dbg(&client->dev, "dev_class: %d\n", optoe->dev_class); |
| 20 | ++ dev_dbg(&client->dev, "dev_class: %d use_smbus=%d\n", optoe->dev_class, use_smbus); |
| 21 | + optoe->use_smbus = use_smbus; |
| 22 | + optoe->chip = chip; |
| 23 | + optoe->num_addresses = num_addresses; |
| 24 | +@@ -1157,7 +1157,7 @@ static int optoe_probe(struct i2c_client *client, |
| 25 | + optoe->write_max = write_max; |
| 26 | + |
| 27 | + /* buffer (data + address at the beginning) */ |
| 28 | +- optoe->writebuf = kmalloc(write_max + 2, GFP_KERNEL); |
| 29 | ++ optoe->writebuf = kmalloc(OPTOE_PAGE_SIZE + 2, GFP_KERNEL); |
| 30 | + if (!optoe->writebuf) { |
| 31 | + err = -ENOMEM; |
| 32 | + goto exit_kfree; |
| 33 | +-- |
| 34 | +2.25.1 |
0 commit comments