Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1076707pxb; Thu, 5 Nov 2020 23:38:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJyWLRk+FZ5Vt064T4XBSfKYXnFZDCKdUUXoqxuaWyMRoCIWdE2MnEwUv9jzQnhBuN3OQaV9 X-Received: by 2002:a50:99d6:: with SMTP id n22mr726305edb.261.1604648317674; Thu, 05 Nov 2020 23:38:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604648317; cv=none; d=google.com; s=arc-20160816; b=CB3eRe6R1l6JN+vrq4ZuLO4YirDx85xycrj5m5tiISsj5AQrz/kE8IiEG9RFS//f3y c+xT8KcPF/uJuF1rPaR03z1B4FWTRboyNpgxrcbDtymqFHHSjwB0b1rrG2Fvj6EFKYbq Q9OI2wa65CjYI18RnZlrmM9XQVr3g9sAYaZnNhjtWt6qyPoqszk8CR0UpkUQZH8ZqCr0 gEQCPw1NEg0szr4yDyiKIetByNpPiI0bKNm5AA4TawTlhFYz8ARH25sFdzA/9EAknQJY /VimPnr94I0l0SCwZ+txvW7X4SG3vyWDxVm6BgEHY2PPReIZU9Y15WIpplBMkRNMDMqC Z7Kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=qmmIKwYZ90BVKQOZUzUSLDoaeQqLehemAxhOjRrw3Ik=; b=CcNdcSfZrkgmvHCzOvnNUFPQFf575g5dApoklaR0ytRYxQgOqKEldBggU0fUpqxXIx j6cHMfp7P3fbJ/M/IG9uSckBmZw20Y/qk7cTR2vz1ZiaOP3S24MwFzy8b7LBCXiM7O6i fPmVKiyWRhX0o6Mt5iT8bJXlsGHJdGgEQeGmWALnxNeMp97+TNbLPRTEJCG4C24BQXQi u/FlFj6LKwLB5aJ2g5UfYN3FefVqLL4m35Zsu7G+h9njfJhrpxQxEvlMXy73m5Ciqa84 OjhYyvT/KjodeL03ZodHfuBSTQYYTimRWzmtaZOzElP7o0+t919b6nEchD+2WUmsD776 IR+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=ffSe7ENo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=st.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b10si243600ejv.433.2020.11.05.23.38.14; Thu, 05 Nov 2020 23:38:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=ffSe7ENo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=st.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726492AbgKFHeP (ORCPT + 99 others); Fri, 6 Nov 2020 02:34:15 -0500 Received: from mx07-00178001.pphosted.com ([185.132.182.106]:56230 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726198AbgKFHeO (ORCPT ); Fri, 6 Nov 2020 02:34:14 -0500 Received: from pps.filterd (m0046037.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0A67WF6s025144; Fri, 6 Nov 2020 08:34:08 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=qmmIKwYZ90BVKQOZUzUSLDoaeQqLehemAxhOjRrw3Ik=; b=ffSe7ENoXdV8XDBuIkygsPI7I9zlHv3zP1l2rV4mRzw2PHpcHk4X5iOK0JjzbtItO6ZB Yl3yF3OUKPgMxpkCe8gU9IyDVPKm3W9h9Fw32zZkvPz7npE67bxg0111k/Z9GA9Tj83g 5FKEGOJ8aI70R10PpIA8Kug3Qw/EWSs3o+Egl+5izPAWUv2sHFCx2SP/fIVk5i4A+GzK da8ndJyCsd0b0yThI3dZi3/K9f0lGwLYISWOTWJh3QW9NrDcKe4bjJ/PTCnq03cppGAV CYKQP0QGJWfo4WEbg9wHQ6SJSxj1hEoKJuD3konduBiMPLG5fWGzrR8wwv4jPnRr06M6 uQ== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 34h00etmn5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 06 Nov 2020 08:34:08 +0100 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 3E38C100038; Fri, 6 Nov 2020 08:34:08 +0100 (CET) Received: from Webmail-eu.st.com (sfhdag2node3.st.com [10.75.127.6]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 322F222667A; Fri, 6 Nov 2020 08:34:08 +0100 (CET) Received: from localhost (10.75.127.50) by SFHDAG2NODE3.st.com (10.75.127.6) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Fri, 6 Nov 2020 08:34:07 +0100 From: To: "Rafael J . Wysocki" , , , Ulf Hansson , Kevin Hilman CC: , Erwan Le Ray , Alexandre TORGUE , Fabrice Gasnier , Pierre-Yves MORDRET , , , Subject: [PATCH v1 1/4] PM / wakeup: Add dev_wakeup_path() helper Date: Fri, 6 Nov 2020 08:33:55 +0100 Message-ID: <20201106073358.8379-2-patrice.chotard@st.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201106073358.8379-1-patrice.chotard@st.com> References: <20201106073358.8379-1-patrice.chotard@st.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.75.127.50] X-ClientProxiedBy: SFHDAG4NODE3.st.com (10.75.127.12) To SFHDAG2NODE3.st.com (10.75.127.6) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.312,18.0.737 definitions=2020-11-06_02:2020-11-05,2020-11-06 signatures=0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Patrice Chotard Add dev_wakeup_path() helper to avoid to spread dev->power.wakeup_path test in drivers. In case CONFIG_PM_SLEEP is not set, wakeup_path is not defined, dev_wakeup_path() is returning false. Signed-off-by: Patrice Chotard --- include/linux/pm_wakeup.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/linux/pm_wakeup.h b/include/linux/pm_wakeup.h index aa3da6611533..196a157456aa 100644 --- a/include/linux/pm_wakeup.h +++ b/include/linux/pm_wakeup.h @@ -84,6 +84,11 @@ static inline bool device_may_wakeup(struct device *dev) return dev->power.can_wakeup && !!dev->power.wakeup; } +static inline bool device_wakeup_path(struct device *dev) +{ + return dev->power.wakeup_path; +} + static inline void device_set_wakeup_path(struct device *dev) { dev->power.wakeup_path = true; @@ -174,6 +179,11 @@ static inline bool device_may_wakeup(struct device *dev) return dev->power.can_wakeup && dev->power.should_wakeup; } +static inline bool device_wakeup_path(struct device *dev) +{ + return false; +} + static inline void device_set_wakeup_path(struct device *dev) {} static inline void __pm_stay_awake(struct wakeup_source *ws) {} -- 2.17.1