Pull request for IPMI for 5.12
Only one change in this pull, but it's required for other things, so it needs to go in. -corey -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE/Q1c5nzg9ZpmiCaGYfOMkJGb/4EFAmAz8v8ACgkQYfOMkJGb /4G9+g/+M/XG9oHd+3i3dFW7l0IL4ew2IJf+KfL5DG74eSLsqyHtYxn4SCxD1kAn TKdlq8Hs2n6QqKdxyVK2DHe4wtohFc6qBmNOpPNprdUq5QJel3b98+hmVnxw2H1w 2RZGAaPIe1ws9QSnakErjxhWYv5/+YvYDlH/R8ogaILEGH1YvssbKX6ielBZWYKd AcuRlktB65o5H9R9K/mevB4bOdjUwY335r1t9Ht/fmIwWk4BnAgyA9PFqaNOa30A Kipa9Sc3JyNKkVEfFM6lf9sMaABRpLgQmqZBkSoX85mRv/5mGvSSAhi2zBbF5B0+ +sQ63dTTK3IatlMW67OFUBXVdrO7QrMzLteaNK4eEMo/G7c1lNWHgDGaPubXsJTH isXdyE0d/dk/5dL3rEYZGYWwkB06BfOx85fNkwQTcKXDaF/CF2xI2RLGLGQd/0XX 8sMKv94ih/3iGBJTFrUrRTY7oJJiQG7l6y8dy7H+Cg2oN3w0+9Vu077qW8D0WGfA gtbmqNjC7CFyiRWS//wYdePJyAfAXTfkcIOonajA3J/HmSIzz5ktkp2ARu64PcpY 4Q+WzKXF7lB8ddqelnw7aoO1hDYqeq/7PSNisQqctKlGrvQGnnIQ+3tYvyKykF8N EhatlXsNcBoeezVAspRLXn1qZKVAmmRLZNOTFBQYuI7HBSp44t4= =ps08 -----END PGP SIGNATURE----- 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
This commit is contained in:
commit
f81f213850
|
@ -137,7 +137,7 @@ static ssize_t ipmb_write(struct file *file, const char __user *buf,
|
|||
{
|
||||
struct ipmb_dev *ipmb_dev = to_ipmb_dev(file);
|
||||
u8 rq_sa, netf_rq_lun, msg_len;
|
||||
union i2c_smbus_data data;
|
||||
struct i2c_client *temp_client;
|
||||
u8 msg[MAX_MSG_LEN];
|
||||
ssize_t ret;
|
||||
|
||||
|
@ -160,21 +160,21 @@ static ssize_t ipmb_write(struct file *file, const char __user *buf,
|
|||
}
|
||||
|
||||
/*
|
||||
* subtract rq_sa and netf_rq_lun from the length of the msg passed to
|
||||
* i2c_smbus_xfer
|
||||
* subtract rq_sa and netf_rq_lun from the length of the msg. Fill the
|
||||
* temporary client. Note that its use is an exception for IPMI.
|
||||
*/
|
||||
msg_len = msg[IPMB_MSG_LEN_IDX] - SMBUS_MSG_HEADER_LENGTH;
|
||||
if (msg_len > I2C_SMBUS_BLOCK_MAX)
|
||||
msg_len = I2C_SMBUS_BLOCK_MAX;
|
||||
temp_client = kmemdup(ipmb_dev->client, sizeof(*temp_client), GFP_KERNEL);
|
||||
if (!temp_client)
|
||||
return -ENOMEM;
|
||||
|
||||
data.block[0] = msg_len;
|
||||
memcpy(&data.block[1], msg + SMBUS_MSG_IDX_OFFSET, msg_len);
|
||||
ret = i2c_smbus_xfer(ipmb_dev->client->adapter, rq_sa,
|
||||
ipmb_dev->client->flags,
|
||||
I2C_SMBUS_WRITE, netf_rq_lun,
|
||||
I2C_SMBUS_BLOCK_DATA, &data);
|
||||
temp_client->addr = rq_sa;
|
||||
|
||||
return ret ? : count;
|
||||
ret = i2c_smbus_write_block_data(temp_client, netf_rq_lun, msg_len,
|
||||
msg + SMBUS_MSG_IDX_OFFSET);
|
||||
kfree(temp_client);
|
||||
|
||||
return ret < 0 ? ret : count;
|
||||
}
|
||||
|
||||
static __poll_t ipmb_poll(struct file *file, poll_table *wait)
|
||||
|
|
Loading…
Reference in New Issue