From patchwork Thu Feb 25 14:57:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 12104233 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 88BA1C433DB for ; Thu, 25 Feb 2021 14:59:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3359664ECE for ; Thu, 25 Feb 2021 14:59:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231335AbhBYO64 (ORCPT ); Thu, 25 Feb 2021 09:58:56 -0500 Received: from mail.kernel.org ([198.145.29.99]:35276 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229507AbhBYO6f (ORCPT ); Thu, 25 Feb 2021 09:58:35 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0504864EC3; Thu, 25 Feb 2021 14:57:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1614265074; bh=hKnrb7BDV9TIMzXlWP4pNXmJJKiuS87VGbVD1hVF7OM=; h=From:To:Cc:Subject:Date:From; b=a4uAqtE4rqkDu+NB/ydjWO/+A6y8IciUikjtofjaHraPdImIG+xB8VMqm20GFI5GH +DCvkYElh2ffIuXc6pOXCHc2x2ewVx8h6jF1PN4LLATCKzhFE/d+m1UYXBOADY7LK/ hY7GI39AkZKy7+9vGG8dkxWJUWUjqkpLu7K9WOfop1OtKz+N1gHS8EBhSUx3xmAiE/ gZ50XyhxezTI60aJGFGZPEWWo+CmkeNFiMBYX1sEHJ7oyvR3qhvRyUMADL5MnewGl4 bTEUgCtmQMfcwTnuynhy0xmwad8cBpuBdKpo2t43lqHvMUUSuLAruc2boRoRiev0nU sca+T3oczW5MA== From: Arnd Bergmann To: Andrew Lunn , Heiner Kallweit , "David S. Miller" , Jakub Kicinski Cc: Arnd Bergmann , Russell King , Florian Fainelli , Ioana Ciornei , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] net: phy: make mdio_bus_phy_suspend/resume as __maybe_unused Date: Thu, 25 Feb 2021 15:57:27 +0100 Message-Id: <20210225145748.404410-1-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Arnd Bergmann When CONFIG_PM_SLEEP is disabled, the compiler warns about unused functions: drivers/net/phy/phy_device.c:273:12: error: unused function 'mdio_bus_phy_suspend' [-Werror,-Wunused-function] static int mdio_bus_phy_suspend(struct device *dev) drivers/net/phy/phy_device.c:293:12: error: unused function 'mdio_bus_phy_resume' [-Werror,-Wunused-function] static int mdio_bus_phy_resume(struct device *dev) The logic is intentional, so just mark these two as __maybe_unused and remove the incorrect #ifdef. Fixes: 4c0d2e96ba05 ("net: phy: consider that suspend2ram may cut off PHY power") Signed-off-by: Arnd Bergmann Reviewed-by: Andrew Lunn --- drivers/net/phy/phy_device.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index ce495473cd5d..cc38e326405a 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -230,7 +230,6 @@ static struct phy_driver genphy_driver; static LIST_HEAD(phy_fixup_list); static DEFINE_MUTEX(phy_fixup_lock); -#ifdef CONFIG_PM static bool mdio_bus_phy_may_suspend(struct phy_device *phydev) { struct device_driver *drv = phydev->mdio.dev.driver; @@ -270,7 +269,7 @@ static bool mdio_bus_phy_may_suspend(struct phy_device *phydev) return !phydev->suspended; } -static int mdio_bus_phy_suspend(struct device *dev) +static __maybe_unused int mdio_bus_phy_suspend(struct device *dev) { struct phy_device *phydev = to_phy_device(dev); @@ -290,7 +289,7 @@ static int mdio_bus_phy_suspend(struct device *dev) return phy_suspend(phydev); } -static int mdio_bus_phy_resume(struct device *dev) +static __maybe_unused int mdio_bus_phy_resume(struct device *dev) { struct phy_device *phydev = to_phy_device(dev); int ret; @@ -316,7 +315,6 @@ static int mdio_bus_phy_resume(struct device *dev) static SIMPLE_DEV_PM_OPS(mdio_bus_phy_pm_ops, mdio_bus_phy_suspend, mdio_bus_phy_resume); -#endif /* CONFIG_PM */ /** * phy_register_fixup - creates a new phy_fixup and adds it to the list