sb/intel/bd82x6x: Align mei_recv_msg() functions

They only differ in rather small details, so we can iron them out.

Tested on Asus P8Z77-V LX2, still boots.

Change-Id: I01907f1b8576e82c74b7beeea31ae8ee3e2cc773
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/42010
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Angel Pons 2020-06-02 13:52:26 +02:00 committed by Patrick Georgi
parent c08d4c5c55
commit 0623b01036
2 changed files with 6 additions and 7 deletions

View File

@ -234,8 +234,7 @@ static int mei_send_msg(struct mei_header *mei, struct mkhi_header *mkhi,
return mei_wait_for_me_ready();
}
static int mei_recv_msg(struct mei_header *mei, struct mkhi_header *mkhi,
void *rsp_data, int rsp_bytes)
static int mei_recv_msg(struct mkhi_header *mkhi, void *rsp_data, int rsp_bytes)
{
struct mei_header mei_rsp;
struct mkhi_header mkhi_rsp;
@ -279,7 +278,8 @@ static int mei_recv_msg(struct mei_header *mei, struct mkhi_header *mkhi,
if (mei_rsp.length & 3)
ndata++;
if (ndata != (expected - 1)) {
printk(BIOS_ERR, "ME: response is missing data\n");
printk(BIOS_ERR, "ME: response is missing data %d != %d\n",
ndata, (expected - 1));
return -1;
}
@ -322,7 +322,7 @@ static inline int mei_sendrecv(struct mei_header *mei, struct mkhi_header *mkhi,
{
if (mei_send_msg(mei, mkhi, req_data) < 0)
return -1;
if (mei_recv_msg(mei, mkhi, rsp_data, rsp_bytes) < 0)
if (mei_recv_msg(mkhi, rsp_data, rsp_bytes) < 0)
return -1;
return 0;
}

View File

@ -234,13 +234,12 @@ static int mei_send_msg(struct mei_header *mei, struct mkhi_header *mkhi,
return mei_wait_for_me_ready();
}
static int mei_recv_msg(struct mkhi_header *mkhi,
void *rsp_data, int rsp_bytes)
static int mei_recv_msg(struct mkhi_header *mkhi, void *rsp_data, int rsp_bytes)
{
struct mei_header mei_rsp;
struct mkhi_header mkhi_rsp;
struct mei_csr me, host;
unsigned int ndata, n/*, me_data_len*/;
unsigned int ndata, n;
unsigned int expected;
u32 *data;