Skip to content

Commit 332ebdb

Browse files
authored
[202405] [optoe] Fix optoe's write_max when using native i2c driver (#410)
Signed-off-by: Mihir Patel <[email protected]>
1 parent 99c16d1 commit 332ebdb

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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

patch/series

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ driver-support-optoe-EOF_fix.patch
2929
driver-support-optoe-chunk-offset-fix.patch
3030
driver-support-optoe-QSFP_DD.patch
3131
driver-support-optoe-write-max.patch
32+
driver-support-optoe-write-max_fix.patch
3233
driver-support-optoe-twoaddr-a2h-access.patch
3334
driver-support-optoe-oneaddr-pageable.patch
3435
driver-support-optoe-update-to-linux-6.1.patch

0 commit comments

Comments
 (0)