From patchwork Sat Feb 9 14:04:40 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gianluca Gennari X-Patchwork-Id: 2120241 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 113A7DF24C for ; Sat, 9 Feb 2013 14:04:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757788Ab3BIOEv (ORCPT ); Sat, 9 Feb 2013 09:04:51 -0500 Received: from mail-ee0-f47.google.com ([74.125.83.47]:33430 "EHLO mail-ee0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757261Ab3BIOEu (ORCPT ); Sat, 9 Feb 2013 09:04:50 -0500 Received: by mail-ee0-f47.google.com with SMTP id e52so2453231eek.20 for ; Sat, 09 Feb 2013 06:04:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer; bh=e4Ss4SVHqDeha/YdPI89FnFq+dLk5sqW+mN2KSm/ZKo=; b=sG76C3oIQR51Y4bXdB0uEpZkbyhkNfApbHKCJh/EiKI/lST4nPMvYhqiIarRFrJvsA ZSD5FhGFc1uMmci36nHb18SrvPzcdLD1z8ebc1w1vIpaKb4ovlqffo7tnwagSA9u+ESW hA60zG/naDcSIz+CgZKZLlmTVuFUbZimNPurs61Zb8RbP42A76aBPcmM65YDFlzjGP3M f2MvyiC7OPDkGcKmCpgOgfNW8VG+owhxkrUJvr0revxFst0BoapyO4XepxoV3yyHk4ki 5G/UQjUVUOsAF3LN/Gx8M5inuYBi0/KAVnYcC3T5Cu4QpmBH6DHkRqH/3E9h7bY5GG1Z XBZQ== X-Received: by 10.14.206.132 with SMTP id l4mr27655121eeo.38.1360418689199; Sat, 09 Feb 2013 06:04:49 -0800 (PST) Received: from localhost.localdomain (93-50-34-119.ip150.fastwebnet.it. [93.50.34.119]) by mx.google.com with ESMTPS id k7sm49832008een.8.2013.02.09.06.04.47 (version=TLSv1 cipher=RC4-SHA bits=128/128); Sat, 09 Feb 2013 06:04:48 -0800 (PST) From: Gianluca Gennari To: linux-media@vger.kernel.org, mchehab@redhat.com Cc: hans.verkuil@cisco.com, Gianluca Gennari Subject: [PATCH] media_build: add PTR_RET to compat.h Date: Sat, 9 Feb 2013 15:04:40 +0100 Message-Id: <1360418680-9682-1-git-send-email-gennarone@gmail.com> X-Mailer: git-send-email 1.8.1.1 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org PTR_RET is used by the solo6x10 staging driver, and was introduced in kernel 2.6.39. Add it to compat.h for compatibility with older kernels. Signed-off-by: Gianluca Gennari --- v4l/compat.h | 10 ++++++++++ v4l/scripts/make_config_compat.pl | 1 + 2 files changed, 11 insertions(+) diff --git a/v4l/compat.h b/v4l/compat.h index 1a82bb7..b27b178 100644 --- a/v4l/compat.h +++ b/v4l/compat.h @@ -1137,4 +1137,14 @@ static inline int usb_translate_errors(int error_code) } #endif +#ifdef NEED_PTR_RET +static inline int __must_check PTR_RET(const void *ptr) +{ + if (IS_ERR(ptr)) + return PTR_ERR(ptr); + else + return 0; +} +#endif + #endif /* _COMPAT_H */ diff --git a/v4l/scripts/make_config_compat.pl b/v4l/scripts/make_config_compat.pl index 583ef9d..51a1f5d 100644 --- a/v4l/scripts/make_config_compat.pl +++ b/v4l/scripts/make_config_compat.pl @@ -588,6 +588,7 @@ sub check_other_dependencies() check_files_for_func("config_enabled", "NEED_IS_ENABLED", "include/linux/kconfig.h"); check_files_for_func("DEFINE_PCI_DEVICE_TABLE", "NEED_DEFINE_PCI_DEVICE_TABLE", "include/linux/pci.h"); check_files_for_func("usb_translate_errors", "NEED_USB_TRANSLATE_ERRORS", "include/linux/usb.h"); + check_files_for_func("PTR_RET", "NEED_PTR_RET", "include/linux/err.h"); # For tests for uapi-dependent logic check_files_for_func_uapi("usb_endpoint_maxp", "NEED_USB_ENDPOINT_MAXP", "usb/ch9.h");