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: 387221 Delivered-To: patch@linaro.org Received: by 2002:a02:290e:0:0:0:0:0 with SMTP id p14csp378492jap; Thu, 25 Feb 2021 06:59:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJy2NmlrRIKU9nsDPtwrMLvgF3hbGDslTpGC8Q101zZo91a5fLpE2yMzZ/GX0gblUWmR71X/ X-Received: by 2002:aa7:d9d7:: with SMTP id v23mr3312833eds.320.1614265195453; Thu, 25 Feb 2021 06:59:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614265195; cv=none; d=google.com; s=arc-20160816; b=tkVzRRJZsFMM3LI+HhbHSxBwmUBb/sQ7VaMRPx5mwPRyMcCUnK96KsnwaRWsvP/ENU NXtkh7owG0zkqndd967oFS844B92+4sKxJ5y0V+yOGcpKzZOmXoB8jriww9iG8fLm/CY cnOAevs1X+kHGLOzxiCUeqfHs3wrcA1oOZj+mMEYEYqIn4Fnawt3VwoKdUTBgRn57v8K IwidMMIHachfR3U2Ms+Cvs8ZtpCG6CHC0KAaFRcLkvvQLHUqKxwQsK7OzaMKG5Vh9O0V xcMIoFeJKw67BIjZN7uBqijsc1pjqhpM0H1B/IeDETS5uyprFk8Jb4M4iEvMi5rEc3ep cs6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=4Uvk8ZDlUgHdXSzyKJkyHO7UZEbQUPEO8c7qwT32JdE=; b=djydlNNuurYyAhzchuIoFWr6lvkdQhMKZ7b0M3O2AISnykE+J5aU5oL9HKISWHbGeV +memtp2jlDhMQX2OFBrtfGXg84C5U5+g/7C0zmVHauNbLjNrn51mQurglf0ivm75fKrV jHGaz3QKyqQVIZtThVnRDP30eM0JXDRqlF2jbB7Ly2NVhu595Gk8UPOiQS7BCWPnVati dN05Cu5G5oXZUvitQtvjo1vrtHeJV5zmDcJ0da8ESPO/IOR6a2ggVhbhSYSpha8+nkEa 5/rHMt2sIlYDbh9zsI7/+tYPFrx/kXMDwwmBCDWTdLAO1uMAGS8WON7Ls8nGbAxtliPp lNDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=a4uAqtE4; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id fs18si3268317ejc.644.2021.02.25.06.59.55; Thu, 25 Feb 2021 06:59:55 -0800 (PST) Received-SPF: pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=a4uAqtE4; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231335AbhBYO64 (ORCPT + 9 others); 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 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 --- drivers/net/phy/phy_device.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) -- 2.29.2 Reviewed-by: Andrew Lunn 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