Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp465324pxk; Thu, 3 Sep 2020 04:43:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxus61loeFEfC3MAJkHVEYwM8IWGdWTnWxAs7PEvBWdZKSwN7UobtdaVh9lVXF85IC9apFt X-Received: by 2002:aa7:c2d6:: with SMTP id m22mr2524572edp.311.1599133427849; Thu, 03 Sep 2020 04:43:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599133427; cv=none; d=google.com; s=arc-20160816; b=Res3dc9Q/++4iKTa9273KFB6S25xos8a/XPlHMauckVpYtlT2Csbe8RJe4SqYIn0/N Z7qVyrTOlTkHLry3FFmkFUkRJcawjmSUdmRw+UJA0mGbgyDi+SGY0tDgLsLDcbnlHshr 2VHQBPYHT996/W4bUml179DNb/wVrrkh+MCGJOHHqrrCpk2gbQtlYrsZZJQqPl/3bsxr mYA61hGnZ2xGpopUWl7tXq7QjqFbneKwmO7IMPc30f+iseh1U0Nwr7lNlbVdQMr/E2Fe 3bg7feAlE2uPosp8ml9hCEVHjUc9kbw/fI0/d6FsjQZJFotV64PIKTdf+2jmMm+7tOcr 5rww== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=So1ydkKuCEbYZRfPCMaB7KCDvSR7hgpAAFNtUES9lnU=; b=DGqAOQlcy5Ysj6WcwzBYN/9fiDktpy0b3C2+RxU3uGIhgIubP8Z0PAsqY04B74LsTs rD0f+wF7Nsc34YBlntSOAeFIoZ4jzhTqPBXSIyJfJDDbu+GeB7rLs42W8eVgJ5K2GTTi onnk4+rwcEMlgMtR9ydM5EswgEgYME66qjiZ2rYDT9irqrCaxE0miiqE7Aa+d4cxvqVv YKnJzCntRz+fPtpxzAzJuq3u36yTdKV5yvuAFAolUhjj2qTF1ctdAzreN7vFWxplnNU8 fml0/9zPGf7aNyJPVZx0DySfjKksBIIXKEZ42Owc9mAWCTcToSKX6ofX101YU0cEMPlb YSGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@crapouillou.net header.s=mail header.b="TdDiNKC/"; 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=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 re10si1799562ejb.140.2020.09.03.04.43.24; Thu, 03 Sep 2020 04:43:47 -0700 (PDT) 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=fail header.i=@crapouillou.net header.s=mail header.b="TdDiNKC/"; 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=fail (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728145AbgICLly (ORCPT + 99 others); Thu, 3 Sep 2020 07:41:54 -0400 Received: from crapouillou.net ([89.234.176.41]:51890 "EHLO crapouillou.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728661AbgICLei (ORCPT ); Thu, 3 Sep 2020 07:34:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1599132397; 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:in-reply-to:references:references; bh=So1ydkKuCEbYZRfPCMaB7KCDvSR7hgpAAFNtUES9lnU=; b=TdDiNKC/us7YKeyMnnsJ+Gvaf3XEHP0+ivVh03DILw/6xdyhGyQYHfRGGRBxn4+7b7Tgdm wwZTFIbsD9ztA92cvXnUd128sxT5s47A/ML1Xf6o+EBbRib8GKDkXWG0m7A4xoDPlpv154 0sKvjhacukZekWOSySQ8noyCTQC5i+U= From: Paul Cercueil To: Greg Kroah-Hartman , Peter Chen , Cristian Birsan , Felipe Balbi , Nicolas Ferre , Alexandre Belloni , Ludovic Desroches , Avi Fishman , Tomer Maimon , Tali Perry , Patrick Venture , Nancy Yuen , Benjamin Fair , Alan Stern , Tony Prisk , Bin Liu , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, openbmc@lists.ozlabs.org, Paul Cercueil Subject: [PATCH 13/20] usb/phy: am335x: Use pm_ptr() macro Date: Thu, 3 Sep 2020 13:25:47 +0200 Message-Id: <20200903112554.34263-14-paul@crapouillou.net> In-Reply-To: <20200903112554.34263-1-paul@crapouillou.net> References: <20200903112554.34263-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 Use the newly introduced pm_ptr() macro, and mark the suspend/resume functions __maybe_unused. These functions can then be moved outside the CONFIG_PM_SUSPEND block, and the compiler can then process them and detect build failures independently of the config. If unused, they will simply be discarded by the compiler. Signed-off-by: Paul Cercueil --- drivers/usb/phy/phy-am335x.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/usb/phy/phy-am335x.c b/drivers/usb/phy/phy-am335x.c index 8524475d942d..a238f866634b 100644 --- a/drivers/usb/phy/phy-am335x.c +++ b/drivers/usb/phy/phy-am335x.c @@ -90,8 +90,7 @@ static int am335x_phy_remove(struct platform_device *pdev) return 0; } -#ifdef CONFIG_PM_SLEEP -static int am335x_phy_suspend(struct device *dev) +static int __maybe_unused am335x_phy_suspend(struct device *dev) { struct am335x_phy *am_phy = dev_get_drvdata(dev); @@ -111,7 +110,7 @@ static int am335x_phy_suspend(struct device *dev) return 0; } -static int am335x_phy_resume(struct device *dev) +static int __maybe_unused am335x_phy_resume(struct device *dev) { struct am335x_phy *am_phy = dev_get_drvdata(dev); @@ -122,7 +121,6 @@ static int am335x_phy_resume(struct device *dev) return 0; } -#endif static SIMPLE_DEV_PM_OPS(am335x_pm_ops, am335x_phy_suspend, am335x_phy_resume); @@ -137,7 +135,7 @@ static struct platform_driver am335x_phy_driver = { .remove = am335x_phy_remove, .driver = { .name = "am335x-phy-driver", - .pm = &am335x_pm_ops, + .pm = pm_ptr(&am335x_pm_ops), .of_match_table = am335x_phy_ids, }, }; -- 2.28.0