From patchwork Fri Jul 3 20:46:52 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean Delvare X-Patchwork-Id: 33990 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n63Kl4kr017466 for ; Fri, 3 Jul 2009 20:47:05 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755660AbZGCUq6 (ORCPT ); Fri, 3 Jul 2009 16:46:58 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757128AbZGCUq6 (ORCPT ); Fri, 3 Jul 2009 16:46:58 -0400 Received: from zone0.gcu-squad.org ([212.85.147.21]:9423 "EHLO services.gcu-squad.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755660AbZGCUq6 (ORCPT ); Fri, 3 Jul 2009 16:46:58 -0400 Received: from jdelvare.pck.nerim.net ([62.212.121.182] helo=hyperion.delvare) by services.gcu-squad.org (GCU Mailer Daemon) with esmtpsa id 1MMqmD-0003Qd-UA (TLSv1:AES256-SHA:256) (envelope-from ) ; Fri, 03 Jul 2009 23:58:38 +0200 Date: Fri, 3 Jul 2009 22:46:52 +0200 From: Jean Delvare To: LMML Cc: Andrzej Hajda Subject: [PATCH 1/2] Compatibility layer for hrtimer API Message-ID: <20090703224652.339a63e7@hyperion.delvare> X-Mailer: Claws Mail 3.5.0 (GTK+ 2.14.4; i586-suse-linux-gnu) Mime-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Kernels 2.6.22 to 2.6.24 (inclusive) need some compatibility quirks for the hrtimer API. For older kernels, some required functions were not exported so there's nothing we can do. This means that drivers using the hrtimer infrastructure will no longer work for kernels older than 2.6.22. Signed-off-by: Jean Delvare --- v4l/compat.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) --- a/v4l/compat.h +++ b/v4l/compat.h @@ -480,4 +480,22 @@ static inline unsigned long v4l_compat_f } #endif +/* + * Compatibility code for hrtimer API + * This will make hrtimer usable for kernels 2.6.22 and later. + * For earlier kernels, not all required functions are exported + * so there's nothing we can do. + */ + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 25) && \ + LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22) +#include +/* Forward a hrtimer so it expires after the hrtimer's current now */ +static inline unsigned long hrtimer_forward_now(struct hrtimer *timer, + ktime_t interval) +{ + return hrtimer_forward(timer, timer->base->get_time(), interval); +} +#endif + #endif /* _COMPAT_H */