From: Bryan O'Donoghue Date: Thu, 3 Dec 2015 17:29:39 +0000 (+0000) Subject: greybus: loopback: Move latency_ts initialization to transfer routine X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d6a1a3b5ea08c7828a177b48e6e39943b0fadf3c;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/greybus/loopback.c b/drivers/staging/greybus/loopback.c index e0be130afb70..7d582cd8127b 100644 --- a/drivers/staging/greybus/loopback.c +++ b/drivers/staging/greybus/loopback.c @@ -463,6 +463,9 @@ static int gb_loopback_transfer(struct gb_loopback *gb, u32 len) struct gb_loopback_transfer_response *response; int retval; + gb->apbridge_latency_ts = 0; + gb->gpbridge_latency_ts = 0; + request = kmalloc(len + sizeof(*request), GFP_KERNEL); if (!request) return -ENOMEM; @@ -777,8 +780,6 @@ static int gb_loopback_fn(void *data) mutex_unlock(&gb->mutex); /* Else operations to perform */ - gb->apbridge_latency_ts = 0; - gb->gpbridge_latency_ts = 0; if (type == GB_LOOPBACK_TYPE_PING) error = gb_loopback_ping(gb); else if (type == GB_LOOPBACK_TYPE_TRANSFER)