mirror of https://gitee.com/openkylin/linux.git
greybus: loopback: Move latency_ts initialization to transfer routine
Initializing the bridge specific latency variables is only relevant to the transfer operation, so make it loopback-transfer specific. Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
parent
d9fb3754ec
commit
d6a1a3b5ea
|
@ -463,6 +463,9 @@ static int gb_loopback_transfer(struct gb_loopback *gb, u32 len)
|
||||||
struct gb_loopback_transfer_response *response;
|
struct gb_loopback_transfer_response *response;
|
||||||
int retval;
|
int retval;
|
||||||
|
|
||||||
|
gb->apbridge_latency_ts = 0;
|
||||||
|
gb->gpbridge_latency_ts = 0;
|
||||||
|
|
||||||
request = kmalloc(len + sizeof(*request), GFP_KERNEL);
|
request = kmalloc(len + sizeof(*request), GFP_KERNEL);
|
||||||
if (!request)
|
if (!request)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
@ -777,8 +780,6 @@ static int gb_loopback_fn(void *data)
|
||||||
mutex_unlock(&gb->mutex);
|
mutex_unlock(&gb->mutex);
|
||||||
|
|
||||||
/* Else operations to perform */
|
/* Else operations to perform */
|
||||||
gb->apbridge_latency_ts = 0;
|
|
||||||
gb->gpbridge_latency_ts = 0;
|
|
||||||
if (type == GB_LOOPBACK_TYPE_PING)
|
if (type == GB_LOOPBACK_TYPE_PING)
|
||||||
error = gb_loopback_ping(gb);
|
error = gb_loopback_ping(gb);
|
||||||
else if (type == GB_LOOPBACK_TYPE_TRANSFER)
|
else if (type == GB_LOOPBACK_TYPE_TRANSFER)
|
||||||
|
|
Loading…
Reference in New Issue