summaryrefslogtreecommitdiffstats
path: root/drivers/char/ipmi/ipmi_ssif.c
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2017-08-25 15:47:23 +0800
committerCorey Minyard <cminyard@mvista.com>2017-09-27 16:03:45 -0500
commitc468f911b73beb39b20f7e5f97a35d41f038b31b (patch)
tree7695d0f263fff5a5b46e270328d8390f4f5cdd59 /drivers/char/ipmi/ipmi_ssif.c
parenta9137c3dfae9f371e302ee3fc6658f0fe6b904e7 (diff)
downloadlinux-c468f911b73beb39b20f7e5f97a35d41f038b31b.tar.bz2
ipmi: Make ipmi_demangle_device_id more generic
Currently, ipmi_demagle_device_id requires a full response buffer in its data argument. This means we can't use it to parse a response in a struct ipmi_recv_msg, which has the netfn and cmd as separate bytes. This change alters the definition and users of ipmi_demangle_device_id to use a split netfn, cmd and data buffer, so it can be used with non-sequential responses. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Fixed the ipmi_ssif.c and ipmi_si_intf.c changes to use data from the response, not the data from the message, when passing info to the ipmi_demangle_device_id() function. Signed-off-by: Corey Minyard <cminyard@mvista.com>
Diffstat (limited to 'drivers/char/ipmi/ipmi_ssif.c')
-rw-r--r--drivers/char/ipmi/ipmi_ssif.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/char/ipmi/ipmi_ssif.c b/drivers/char/ipmi/ipmi_ssif.c
index 0aea3bcb6158..20ab098cd661 100644
--- a/drivers/char/ipmi/ipmi_ssif.c
+++ b/drivers/char/ipmi/ipmi_ssif.c
@@ -1491,7 +1491,8 @@ static int ssif_probe(struct i2c_client *client, const struct i2c_device_id *id)
if (rv)
goto out;
- rv = ipmi_demangle_device_id(resp, len, &ssif_info->device_id);
+ rv = ipmi_demangle_device_id(resp[0] >> 2, resp[1],
+ resp + 2, len - 2, &ssif_info->device_id);
if (rv)
goto out;