Skip to content

Commit

Permalink
[202311] [optoe] Fix optoe's write_max when using native i2c driver (#…
Browse files Browse the repository at this point in the history
…409)

Signed-off-by: Mihir Patel <[email protected]>
  • Loading branch information
mihirpat1 authored Jun 19, 2024
1 parent f5b1c27 commit a02f738
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
34 changes: 34 additions & 0 deletions patch/driver-support-optoe-write-max_fix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
From f1250392a9dff619b147d8aee0c73c0f6d550713 Mon Sep 17 00:00:00 2001
From: Prince George <[email protected]>
Date: Thu, 13 Jun 2024 14:18:22 +0000
Subject: [PATCH] Fix optoe's write_max when using native i2c driver

Signed-off-by: Prince George <[email protected]>
---
drivers/misc/eeprom/optoe.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/misc/eeprom/optoe.c b/drivers/misc/eeprom/optoe.c
index 5a2e71be5..1efd18040 100644
--- a/drivers/misc/eeprom/optoe.c
+++ b/drivers/misc/eeprom/optoe.c
@@ -1114,7 +1114,7 @@ static int optoe_probe(struct i2c_client *client,
goto exit;
}

- dev_dbg(&client->dev, "dev_class: %d\n", optoe->dev_class);
+ dev_dbg(&client->dev, "dev_class: %d use_smbus=%d\n", optoe->dev_class, use_smbus);
optoe->use_smbus = use_smbus;
optoe->chip = chip;
optoe->num_addresses = num_addresses;
@@ -1157,7 +1157,7 @@ static int optoe_probe(struct i2c_client *client,
optoe->write_max = write_max;

/* buffer (data + address at the beginning) */
- optoe->writebuf = kmalloc(write_max + 2, GFP_KERNEL);
+ optoe->writebuf = kmalloc(OPTOE_PAGE_SIZE + 2, GFP_KERNEL);
if (!optoe->writebuf) {
err = -ENOMEM;
goto exit_kfree;
--
2.25.1
1 change: 1 addition & 0 deletions patch/series
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ driver-support-optoe-EOF_fix.patch
driver-support-optoe-chunk-offset-fix.patch
driver-support-optoe-QSFP_DD.patch
driver-support-optoe-write-max.patch
driver-support-optoe-write-max_fix.patch
driver-support-optoe-twoaddr-a2h-access.patch
driver-support-optoe-oneaddr-pageable.patch
driver-support-optoe-dynamic-write-timeout.patch
Expand Down

0 comments on commit a02f738

Please sign in to comment.