From patchwork Sun Jul 23 12:12:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jasmin J." X-Patchwork-Id: 9858405 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 EF3AA603B4 for ; Sun, 23 Jul 2017 12:12:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DCFDB2852D for ; Sun, 23 Jul 2017 12:12:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CBC0628562; Sun, 23 Jul 2017 12:12:29 +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 8690728556 for ; Sun, 23 Jul 2017 12:12:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755289AbdGWMMV (ORCPT ); Sun, 23 Jul 2017 08:12:21 -0400 Received: from mail.anw.at ([195.234.101.228]:38978 "EHLO mail.anw.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755283AbdGWMMU (ORCPT ); Sun, 23 Jul 2017 08:12:20 -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 v6NCCCN4014803; Sun, 23 Jul 2017 14:12:18 +0200 From: "Jasmin J." To: linux-media@vger.kernel.org Cc: hverkuil@xs4all.nl, d.scheller@gmx.net, jasmin@anw.at Subject: [PATCH 1/3] build: Add compat code for pm_runtime_get_if_in_use Date: Sun, 23 Jul 2017 14:12:02 +0200 Message-Id: <1500811924-4559-2-git-send-email-jasmin@anw.at> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1500811924-4559-1-git-send-email-jasmin@anw.at> References: <1500811924-4559-1-git-send-email-jasmin@anw.at> X-Antivirus: checked in 0.015sec 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 Signed-off-by: Jasmin Jessich --- v4l/compat.h | 15 +++++++++++++++ v4l/scripts/make_config_compat.pl | 1 + 2 files changed, 16 insertions(+) diff --git a/v4l/compat.h b/v4l/compat.h index e565292..b5b0846 100644 --- a/v4l/compat.h +++ b/v4l/compat.h @@ -2084,4 +2084,19 @@ static inline void *skb_put_data(struct sk_buff *skb, const void *data, } #endif +#ifdef NEED_PM_RUNTIME_GET +static inline int pm_runtime_get_if_in_use(struct device *dev) +{ + unsigned long flags; + int retval; + + spin_lock_irqsave(&dev->power.lock, flags); + retval = dev->power.disable_depth > 0 ? -EINVAL : + dev->power.runtime_status == RPM_ACTIVE + && atomic_inc_not_zero(&dev->power.usage_count); + spin_unlock_irqrestore(&dev->power.lock, flags); + return retval; +} +#endif + #endif /* _COMPAT_H */ diff --git a/v4l/scripts/make_config_compat.pl b/v4l/scripts/make_config_compat.pl index 5ac59ab..be278aa 100644 --- a/v4l/scripts/make_config_compat.pl +++ b/v4l/scripts/make_config_compat.pl @@ -700,6 +700,7 @@ sub check_other_dependencies() check_files_for_func("to_of_node", "NEED_TO_OF_NODE", "include/linux/of.h"); check_files_for_func("is_of_node", "NEED_IS_OF_NODE", "include/linux/of.h"); check_files_for_func("skb_put_data", "NEED_SKB_PUT_DATA", "include/linux/skbuff.h"); + check_files_for_func("pm_runtime_get_if_in_use", "NEED_PM_RUNTIME_GET", "include/linux/pm_runtime.h"); # For tests for uapi-dependent logic check_files_for_func_uapi("usb_endpoint_maxp", "NEED_USB_ENDPOINT_MAXP", "usb/ch9.h");