From nobody Tue Sep 16 13:53:39 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 668EFC46467 for ; Mon, 2 Jan 2023 19:52:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232862AbjABTwj (ORCPT ); Mon, 2 Jan 2023 14:52:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229627AbjABTwg (ORCPT ); Mon, 2 Jan 2023 14:52:36 -0500 Received: from mail-108-mta183.mxroute.com (mail-108-mta183.mxroute.com [136.175.108.183]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E963CEA for ; Mon, 2 Jan 2023 11:52:33 -0800 (PST) Received: from mail-111-mta2.mxroute.com ([136.175.111.2] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta183.mxroute.com (ZoneMTA) with ESMTPSA id 185740aea35000011e.006 for (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256); Mon, 02 Jan 2023 19:52:30 +0000 X-Zone-Loop: aaf617fabb8f6dc65bc661d9b477f45c5bb54c80fe6f X-Originating-IP: [136.175.111.2] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=c8h4.io; s=x; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject:Cc:To: From:Sender:Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=PvmwkN+BYUCQUQdJYFAdNwIAg6Wx6lg7uwVGd3w86p8=; b=v puUTB7H/Bk2aXZySHZLXjZXjcaXmBM4US4tl2Mczo/KGnNK1h06QO7QVWcG6mPFR6Ua7dnvPGWfNa 4Fp6LYm+8pRF8awM6mt6DNy5CFxq02U+nF/McR5ywRn6/L2IXeeEr2tMlZ8m19D8ek7mCumLFy0bU l7p1Gg7qYqBuOC6TK4y58oat4/f4OZDKJyoX9ASK0MaQ5B5c1mTOH13qlRf9S73mFt3pEvsodux9O MXaATBenMIHWS2W/RhfgzRUGsnlGCOuo6opfd8uHo6fSuYGcoXVDgGZaepU7ZqazRvlTn9F9VeNXD 9gcySyR1urHIRp6RRnHSoTzS8x4z7Vd8Q==; From: Christoph Heiss To: Chris Snook , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next] net: alx: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() Date: Mon, 2 Jan 2023 20:51:18 +0100 Message-Id: <20230102195118.1164280-1-christoph@c8h4.io> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Authenticated-Id: christoph@c8h4.io Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Using these macros allows to remove an #ifdef-guard on CONFIG_PM_SLEEP. No functional changes. Signed-off-by: Christoph Heiss --- drivers/net/ethernet/atheros/alx/main.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/net/ethernet/atheros/alx/main.c b/drivers/net/ethernet= /atheros/alx/main.c index d30d11872719..306393f8eeca 100644 --- a/drivers/net/ethernet/atheros/alx/main.c +++ b/drivers/net/ethernet/atheros/alx/main.c @@ -1905,7 +1905,6 @@ static void alx_remove(struct pci_dev *pdev) free_netdev(alx->dev); } -#ifdef CONFIG_PM_SLEEP static int alx_suspend(struct device *dev) { struct alx_priv *alx =3D dev_get_drvdata(dev); @@ -1951,12 +1950,7 @@ static int alx_resume(struct device *dev) return err; } -static SIMPLE_DEV_PM_OPS(alx_pm_ops, alx_suspend, alx_resume); -#define ALX_PM_OPS (&alx_pm_ops) -#else -#define ALX_PM_OPS NULL -#endif - +static DEFINE_SIMPLE_DEV_PM_OPS(alx_pm_ops, alx_suspend, alx_resume); static pci_ers_result_t alx_pci_error_detected(struct pci_dev *pdev, pci_channel_state_t state) @@ -2055,7 +2049,7 @@ static struct pci_driver alx_driver =3D { .probe =3D alx_probe, .remove =3D alx_remove, .err_handler =3D &alx_err_handlers, - .driver.pm =3D ALX_PM_OPS, + .driver.pm =3D pm_sleep_ptr(&alx_pm_ops), }; module_pci_driver(alx_driver); -- 2.39.0