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: 10741479 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 BCF7F14E2 for ; Sat, 22 Dec 2018 20:27:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A798628A51 for ; Sat, 22 Dec 2018 20:27:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9BB6E28A53; Sat, 22 Dec 2018 20:27:28 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 51EFE28A51 for ; Sat, 22 Dec 2018 20:27:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=DrmFAocQrTEKmAqmzSgzJrkR3q3gXJbXzR8+sJ2qxPw=; b=lCcCFbNi+fSG7O IB5UOJfSvwAk63+Kpw0ugYDRBnZZ8VVrHwTzEw9kj6yB8eIXsrJ+bL5U6RdI7V2b+jdC2CnP2S9z1 8oz81L8LDAHn4mfmR97Tl4VzfrmDx4MP61+sWmW/q1oq+U/Z1tWn47b5EHmPKWj5edYlvmHLBcjOf X7hN927n+ScW/SAdaqarCtxpeNXgkykJaKZ/+DsDE23ZIWqdAYegu3O3nYBtBFsWtlvOYBStCYKtm CDyBGu4OfNyg1FtvBh4SThME2mfj+2vn5xPiJIv6mGPOyvWNDrvWu+Ef+5Fo4ROQU5Rc8uYhjfytd IU7scHxAJa0td2QUCGLw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1ganrf-0000AN-FC; Sat, 22 Dec 2018 20:27:15 +0000 Received: from sauhun.de ([88.99.104.3] helo=pokefinder.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1ganrD-000884-8p for linux-arm-kernel@lists.infradead.org; Sat, 22 Dec 2018 20:26:48 +0000 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181222_122647_464673_9BBAE2B8 X-CRM114-Status: UNSURE ( 8.83 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Wolfram Sang , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Hans de Goede , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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)