Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4143526ybb; Tue, 14 Apr 2020 01:08:52 -0700 (PDT) X-Google-Smtp-Source: APiQypJ7Lyr2lmVNVTzBE+oa3ecJXEULSO/Gig4X+FoKqtrAx8NMz3WuE0dXTTzeRdVrrlvJvHgS X-Received: by 2002:a50:9e29:: with SMTP id z38mr19687144ede.345.1586851732812; Tue, 14 Apr 2020 01:08:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586851732; cv=none; d=google.com; s=arc-20160816; b=iJq8B6yVca1IbHD8/mAcutFU4ZWYvEWcon3SF3oJ7zG1B3eF0OUE+sPmxVT9MwhX0s 0S0apoOKJCguqyVC9aa8a3+PrJ8lx4oTutOUSyH/+Y0LLbZzuoPiaxOl/K5tZNbMQ6ed Yh+55ZPkKbEodLN5/S9MpOhOOsXHJX45C4XMBPjQoMUVREozwrk4gdUaMQa0shxCbwfa Kqr/DDz9VRDAZ0lT+V4YOgCfP6Ry1PSCRYeImkl8O4eonOh+6ASG7R/QyPQSs6YgpcWQ fzAJ6E2be7FS+XglQJR1/DJ1H+X5yVk2ngttyGTXPdvB7GJGxCzjlyCsWlERZgOol3ui Rigg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=QlPjAfIdxHj090lbf0AL7B7989su6jjJKS5OiMvvzVo=; b=Cj5mcrVBBDX5wAMvGxFdWirRX9Z3XiAB4H37IXpbBTerFm5e2tYwd9KrXT+eiMYoSO gHJWgWfzvC38Lcm7+Y8+cRILXEsRp8RKcMLJbea5KdMI7ln0AjRXBYUlSM3uNU9mywmP /c/QlkBMVX4EIuTP17MvJAiefTUMYhlLOlRdMqHreKdyjAanccScYGSp2HU9g2vya8uv GZ2c65A7DfOIQvWpnTMtMOIlxvPY0fiSl1QrhPv7bsCbbjlVaJq/ckK1sz+voHu1ik8S ca4zZWOsiwRxo7Bj3kq3LCOyQd9+fbAqnL7m73XLlhMtYSEMT+F+E20G2ORC+g/P5rgz xKUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@crapouillou.net header.s=mail header.b=NrwbG2DM; spf=pass (google.com: best guess record for 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=fail (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j21si7599040ejc.343.2020.04.14.01.08.29; Tue, 14 Apr 2020 01:08:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for 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=fail header.i=@crapouillou.net header.s=mail header.b=NrwbG2DM; spf=pass (google.com: best guess record for 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=fail (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729494AbgDMMcP (ORCPT + 99 others); Mon, 13 Apr 2020 08:32:15 -0400 Received: from outils.crapouillou.net ([89.234.176.41]:38224 "EHLO crapouillou.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728392AbgDMMcO (ORCPT ); Mon, 13 Apr 2020 08:32:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1586781132; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references; bh=QlPjAfIdxHj090lbf0AL7B7989su6jjJKS5OiMvvzVo=; b=NrwbG2DMnHeYDYnmBQ+HqRUSGSlIHH5XnXzPDiJSIODzVNKjXubrbXIDykEIIjbfE6HeUO KQN54fBp1Br1FWhIXSqUMOQsevNi/WkNXZmfd/hNylSTL81Cn6T+mpymu0HCTYkhfOnWts ho5GTCRvVdlClxVX7Bu5/SwzucQPvy4= From: Paul Cercueil To: Ulf Hansson , "Rafael J . Wysocki" , Pavel Machek , Len Brown Cc: od@zcrc.me, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Paul Cercueil Subject: [PATCH v2 1/3] PM: introduce pm_ptr() macro Date: Mon, 13 Apr 2020 14:32:05 +0200 Message-Id: <20200413123207.74552-1-paul@crapouillou.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This macro is analogous to the infamous of_match_ptr(). If CONFIG_PM is enabled, this macro will resolve to its argument, otherwise to NULL. Signed-off-by: Paul Cercueil --- Notes: v2: Remove pm_sleep_ptr() macro include/linux/pm.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/linux/pm.h b/include/linux/pm.h index e057d1fa2469..1c0eec06905d 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h @@ -374,6 +374,12 @@ const struct dev_pm_ops name = { \ SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \ } +#ifdef CONFIG_PM +#define pm_ptr(_ptr) (_ptr) +#else +#define pm_ptr(_ptr) NULL +#endif + /* * PM_EVENT_ messages * -- 2.25.1