realtek: i2c-rtl9300: fix crash on block transfers

Fix a typo which resulted in wrong .read hooks and unset .write
hooks.  This made I2C_SMBUS_BLOCK_DATA transfers dereference the
NULL .write hook and Oops.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
Link: https://github.com/openwrt/openwrt/pull/17950
Signed-off-by: Sander Vanheule <sander@svanheule.net>
This commit is contained in:
Bjørn Mork 2025-02-05 07:19:10 +01:00 committed by Sander Vanheule
parent d5dcb88906
commit ef4b022150

View File

@ -436,7 +436,7 @@ struct i2c_drv_data rtl9300_i2c_drv_data = {
.scl1_pin = 17,
.sda0_pin = 9,
.read = rtl9300_i2c_read,
.read = rtl9300_i2c_write,
.write = rtl9300_i2c_write,
.reg_addr_set = rtl9300_i2c_reg_addr_set,
.config_xfer = rtl9300_i2c_config_xfer,
.execute_xfer = rtl9300_execute_xfer,
@ -450,7 +450,7 @@ struct i2c_drv_data rtl9310_i2c_drv_data = {
.scl1_pin = 14,
.sda0_pin = 0,
.read = rtl9310_i2c_read,
.read = rtl9310_i2c_write,
.write = rtl9310_i2c_write,
.reg_addr_set = rtl9310_i2c_reg_addr_set,
.config_xfer = rtl9310_i2c_config_xfer,
.execute_xfer = rtl9310_execute_xfer,