Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'for-linus-5.12-1' of git://github.com/cminyard/linux-ipmi

Pull IPMI update from Corey Minyard:
"Only one change, but it's required for other things, so it needs to go
in"

* tag 'for-linus-5.12-1' of git://github.com/cminyard/linux-ipmi:
ipmi: remove open coded version of SMBus block write

+12 -12
+12 -12
drivers/char/ipmi/ipmb_dev_int.c
··· 137 137 { 138 138 struct ipmb_dev *ipmb_dev = to_ipmb_dev(file); 139 139 u8 rq_sa, netf_rq_lun, msg_len; 140 - union i2c_smbus_data data; 140 + struct i2c_client *temp_client; 141 141 u8 msg[MAX_MSG_LEN]; 142 142 ssize_t ret; 143 143 ··· 160 160 } 161 161 162 162 /* 163 - * subtract rq_sa and netf_rq_lun from the length of the msg passed to 164 - * i2c_smbus_xfer 163 + * subtract rq_sa and netf_rq_lun from the length of the msg. Fill the 164 + * temporary client. Note that its use is an exception for IPMI. 165 165 */ 166 166 msg_len = msg[IPMB_MSG_LEN_IDX] - SMBUS_MSG_HEADER_LENGTH; 167 - if (msg_len > I2C_SMBUS_BLOCK_MAX) 168 - msg_len = I2C_SMBUS_BLOCK_MAX; 167 + temp_client = kmemdup(ipmb_dev->client, sizeof(*temp_client), GFP_KERNEL); 168 + if (!temp_client) 169 + return -ENOMEM; 169 170 170 - data.block[0] = msg_len; 171 - memcpy(&data.block[1], msg + SMBUS_MSG_IDX_OFFSET, msg_len); 172 - ret = i2c_smbus_xfer(ipmb_dev->client->adapter, rq_sa, 173 - ipmb_dev->client->flags, 174 - I2C_SMBUS_WRITE, netf_rq_lun, 175 - I2C_SMBUS_BLOCK_DATA, &data); 171 + temp_client->addr = rq_sa; 176 172 177 - return ret ? : count; 173 + ret = i2c_smbus_write_block_data(temp_client, netf_rq_lun, msg_len, 174 + msg + SMBUS_MSG_IDX_OFFSET); 175 + kfree(temp_client); 176 + 177 + return ret < 0 ? ret : count; 178 178 } 179 179 180 180 static __poll_t ipmb_poll(struct file *file, poll_table *wait)