Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp11001398rwl; Mon, 2 Jan 2023 11:57:59 -0800 (PST) X-Google-Smtp-Source: AMrXdXuBnF6vS+wpj6VDFlKXeayrGqwOaHzP/MwUp34SGqob5RUPZrkwXXwfQu/H7tzTPSVxJk9p X-Received: by 2002:a17:906:704a:b0:83f:cbc0:1b30 with SMTP id r10-20020a170906704a00b0083fcbc01b30mr33561276ejj.10.1672689479421; Mon, 02 Jan 2023 11:57:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672689479; cv=none; d=google.com; s=arc-20160816; b=QDR9r/15N8XggspchjRqOc6rqsDwlKQtApM0AkfxoBgK7OzHfdBZXsS3SeOyEjKl3B c9c8pmDpENrFnNPf+m5jawUnDujhrA/zoo8S/P3oTcoe4kOfdYydJay6tlVaBJYf6tGV CvB8D3Mey7uS7tLafJnO2h8GuFVa2P81xNPF82s5qYsgdIEmmef5nvGtE75HelyHe1dN 4523af5/TyDWFV1pdSEsIlaS1Jj10CFtQfbipEPr0oWYuVJetZhHW08H+/r7G2Egy8a4 Tz4y6JvuL6zodZY7+d011AifYqjcz7jzHjPeg7Db74tcTKRHbGoSPwOI72snqAXpzZfO N5nw== 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=PvmwkN+BYUCQUQdJYFAdNwIAg6Wx6lg7uwVGd3w86p8=; b=wWJLtHEZ7UUdhKf1YbPfKDYysSSNtNGicx2ZmJERZUTJhT9EozzbNwivoD57uCQfRz xXAhbc09iENccqmw2dz45R28rDtQWbxGWkRHsOGZnj+mRG4thLf5bI8KAYbIJvNK472C QcxyBk2QtW1VW1CT85sa9fK//omxbDckFuzJGTzkLcR8WN72yuFymUHXUYuNElrgCtIk cB3a8FZiRLu9JAKm24Hs1/rMJNJAbeb17IjZaDX0KEG+NFBE4XeEVuQlF8ZTdv10zJP2 4HYQfaw3e4KMg4nOLCt69nP5uUzUFueQ4HxuZSfNSeFLuASVtCAHGYtA34u1o7X+cgWU 9yIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@c8h4.io header.s=x header.b=vpuUTB7H; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t18-20020a1709063e5200b007c177f0064dsi20563445eji.972.2023.01.02.11.57.45; Mon, 02 Jan 2023 11:57:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@c8h4.io header.s=x header.b=vpuUTB7H; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232596AbjABTwi (ORCPT + 61 others); Mon, 2 Jan 2023 14:52:38 -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: 8bit X-Authenticated-Id: christoph@c8h4.io X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 = 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 = { .probe = alx_probe, .remove = alx_remove, .err_handler = &alx_err_handlers, - .driver.pm = ALX_PM_OPS, + .driver.pm = pm_sleep_ptr(&alx_pm_ops), }; module_pci_driver(alx_driver); -- 2.39.0