From patchwork Sun Mar 25 00:29:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jasmin J." X-Patchwork-Id: 10306455 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2109160349 for ; Sun, 25 Mar 2018 00:29:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EDEE029351 for ; Sun, 25 Mar 2018 00:29:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DE10F29353; Sun, 25 Mar 2018 00:29:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BBF6329351 for ; Sun, 25 Mar 2018 00:29:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753014AbeCYA3x (ORCPT ); Sat, 24 Mar 2018 20:29:53 -0400 Received: from mail.anw.at ([195.234.101.228]:39505 "EHLO mail.anw.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752944AbeCYA3w (ORCPT ); Sat, 24 Mar 2018 20:29:52 -0400 Received: from hoppel.217.196.72.190 (anwhome.anw.at [195.234.103.23]) by mail.anw.at (8.14.4/8.14.4/Debian-4.1ubuntu1) with ESMTP id w2P0TouJ004961; Sun, 25 Mar 2018 01:29:50 +0100 From: "Jasmin J." To: linux-media@vger.kernel.org Cc: hverkuil@xs4all.nl, jasmin@anw.at Subject: [PATCH] media: cec-pin: Fixed ktime_t to ns conversion Date: Sun, 25 Mar 2018 01:29:46 +0100 Message-Id: <1521937786-28152-1-git-send-email-jasmin@anw.at> X-Mailer: git-send-email 2.7.4 X-Antivirus: checked in 0.016sec at mail.anw.at ([195.234.102.72]) by smf-clamd v1.2.1 - http://smfs.sf.net/ Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Jasmin Jessich Older Kernels use a struct for ktime_t, which requires the conversion function ktime_to_ns to be used on some places. With this patch it will compile now also for older Kernel versions. Signed-off-by: Jasmin Jessich --- drivers/media/cec/cec-pin.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/cec/cec-pin.c b/drivers/media/cec/cec-pin.c index fafe1eb..2a5df99 100644 --- a/drivers/media/cec/cec-pin.c +++ b/drivers/media/cec/cec-pin.c @@ -668,7 +668,7 @@ static void cec_pin_rx_states(struct cec_pin *pin, ktime_t ts) /* Start bit low is too short, go back to idle */ if (delta < CEC_TIM_START_BIT_LOW_MIN - CEC_TIM_IDLE_SAMPLE) { if (!pin->rx_start_bit_low_too_short_cnt++) { - pin->rx_start_bit_low_too_short_ts = pin->ts; + pin->rx_start_bit_low_too_short_ts = ktime_to_ns(pin->ts); pin->rx_start_bit_low_too_short_delta = delta; } cec_pin_to_idle(pin); @@ -700,7 +700,7 @@ static void cec_pin_rx_states(struct cec_pin *pin, ktime_t ts) /* Start bit is too short, go back to idle */ if (delta < CEC_TIM_START_BIT_TOTAL_MIN - CEC_TIM_IDLE_SAMPLE) { if (!pin->rx_start_bit_too_short_cnt++) { - pin->rx_start_bit_too_short_ts = pin->ts; + pin->rx_start_bit_too_short_ts = ktime_to_ns(pin->ts); pin->rx_start_bit_too_short_delta = delta; } cec_pin_to_idle(pin); @@ -770,7 +770,7 @@ static void cec_pin_rx_states(struct cec_pin *pin, ktime_t ts) */ if (delta < CEC_TIM_DATA_BIT_TOTAL_MIN) { if (!pin->rx_data_bit_too_short_cnt++) { - pin->rx_data_bit_too_short_ts = pin->ts; + pin->rx_data_bit_too_short_ts = ktime_to_ns(pin->ts); pin->rx_data_bit_too_short_delta = delta; } cec_pin_low(pin);