From patchwork Sat Dec 22 20:26:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 10741503 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 82EA86C5 for ; Sat, 22 Dec 2018 20:27:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7366328A4F for ; Sat, 22 Dec 2018 20:27:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 67C1228A52; Sat, 22 Dec 2018 20:27:54 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 0192028A4F for ; Sat, 22 Dec 2018 20:27:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392837AbeLVU1s (ORCPT ); Sat, 22 Dec 2018 15:27:48 -0500 Received: from sauhun.de ([88.99.104.3]:52654 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388396AbeLVU0e (ORCPT ); Sat, 22 Dec 2018 15:26:34 -0500 Received: from localhost (p54B67A8B.dip0.t-ipconnect.de [84.182.122.139]) by pokefinder.org (Postfix) with ESMTPSA id E27E42E3560; Sat, 22 Dec 2018 21:26:31 +0100 (CET) From: Wolfram Sang To: linux-i2c@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, linux-pm@vger.kernel.org, Hans de Goede , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Wolfram Sang Subject: [PATCH v2 1/9] PM / core: add helper to return suspend status of a device Date: Sat, 22 Dec 2018 21:26:15 +0100 Message-Id: <20181222202623.4521-2-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181222202623.4521-1-wsa+renesas@sang-engineering.com> References: <20181222202623.4521-1-wsa+renesas@sang-engineering.com> MIME-Version: 1.0 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP I2C core would like this to reject transfers on an already suspended adapter. Signed-off-by: Wolfram Sang --- include/linux/device.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/linux/device.h b/include/linux/device.h index 1b25c7a43f4c..e63d3e06989f 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -1138,6 +1138,11 @@ static inline int device_is_registered(struct device *dev) return dev->kobj.state_in_sysfs; } +static inline bool device_is_suspended(struct device *dev) +{ + return dev->power.is_suspended; +} + static inline void device_enable_async_suspend(struct device *dev) { if (!dev->power.is_prepared)