Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp649404rwb; Wed, 16 Nov 2022 06:02:57 -0800 (PST) X-Google-Smtp-Source: AA0mqf74nFEILnrQ6KIV3nSS61Sv0vc+YZM/z368eo7qTPevgbiqE5pCZyXV/Zxys9ViuLW7H+m5 X-Received: by 2002:a63:ec03:0:b0:473:e2bb:7fc7 with SMTP id j3-20020a63ec03000000b00473e2bb7fc7mr20350824pgh.40.1668607376928; Wed, 16 Nov 2022 06:02:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668607376; cv=none; d=google.com; s=arc-20160816; b=MvjIh7U1UW6VEmHfp6UqCbwVEGDE2tDxjLLrMnfpVGUEl5wPp/HiXxWI+oSCOJ62fI l0wcv2+E4Ui+4NPURi7vdgXyUeEwolpyX2NYw1X8E3kQgbKzb5p5NXpMSB5mYccqYbzL aRcsqljS82FeHvS3d1u3VdBXwWKI5+RLyrIDHSANHieMd4qMWJ0NdUwlJdk3BGHJ7oGv BszuA8R9R1FxsKh4g2AfzE0dfvFLYToxS4GWZlXUTgoIqIjindhker7+jzdDgqqnlqqL +lQ/3hq4NbTQ+KmnbkutKR8RxYZmLE+A4pWruiIp0g0NwxHM883oPFVvT7Iek9nh1YPW Fw7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:message-id:date:to:cc:from:subject :references:in-reply-to:content-transfer-encoding:mime-version :dkim-signature; bh=yAsncTSeB8lkfZYLveeqZ1nLvsn/1lCy3o+U2Ea/UR8=; b=sgIxqx796a0tWqKeJPwotMsmMlpVs7iwAx69uoERuGj+Nf8iM5zkkEqZRzgBGLFfMN WSnCjJ8XUy8yt40mS0S4lClfioHvWV5tzW9mpIQAczuKfNDLFumPSIbumMp4pq+BjRgF 48NKKhmf9xkeNGQuefWYZfTbxlxNAjhLy9RIZPXPZPoxn6AKEPnIbixBmB/6ydFGFvAx /ACpqExfgfPIDuvCSgvabkgqqqOOopbmvepeBsiSbr2olyazF4UlPsNuxNVvSXfgyPAM 1u4zX/Vog4IqLGzHkIvP8pO875/vp8mMTQvOm0ab3hEXcGajGkbK4V7YKf+DP59Q1gh9 w4XQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=PiSQRbxC; 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 d21-20020a056a00199500b00562617987a1si16155956pfl.264.2022.11.16.06.02.23; Wed, 16 Nov 2022 06:02:56 -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=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=PiSQRbxC; 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 S238299AbiKPNll (ORCPT + 91 others); Wed, 16 Nov 2022 08:41:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54532 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238662AbiKPNlT (ORCPT ); Wed, 16 Nov 2022 08:41:19 -0500 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E4EB1E3FC; Wed, 16 Nov 2022 05:41:16 -0800 (PST) Received: from pendragon.ideasonboard.com (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id BF5B049C; Wed, 16 Nov 2022 14:41:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1668606074; bh=7kjV9XaHGlcIvSJMo1l48yxddcL5QyvUynUQIQE/utQ=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=PiSQRbxCpnhfvhLOvIlPUw+8d+v/T/vnY2kITjyVbbBRPRnaI26+x6KjSeEJAkFiE R/4WIZXhHw0F1vbQABp1Wn2bdozEEwXuxGS45peSlO4RxQUTFRRahTtr9S6UAmjYat S/H9lzSD7Uf3qXQDbCCMFxxR29ESVlnrcRDsinKk= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <20221107175256.360839-7-paul@crapouillou.net> References: <20221107175106.360578-1-paul@crapouillou.net> <20221107175256.360839-1-paul@crapouillou.net> <20221107175256.360839-7-paul@crapouillou.net> Subject: Re: [PATCH 17/26] drm: rcar-du: Remove #ifdef guards for PM related functions From: Kieran Bingham Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Paul Cercueil , Laurent Pinchart , linux-renesas-soc@vger.kernel.org To: Daniel Vetter , David Airlie , Maarten Lankhorst , Maxime Ripard , Paul Cercueil , Thomas Zimmermann Date: Wed, 16 Nov 2022 13:41:12 +0000 Message-ID: <166860607235.50677.11372324946195607108@Monstersaurus> User-Agent: alot/0.10 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_PASS,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 Quoting Paul Cercueil (2022-11-07 17:52:47) > Use the DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() macros to handle > the .suspend/.resume callbacks. >=20 > These macros allow the suspend and resume functions to be automatically > dropped by the compiler when CONFIG_SUSPEND is disabled, without having > to use #ifdef guards. >=20 > This has the advantage of always compiling these functions in, > independently of any Kconfig option. Thanks to that, bugs and other > regressions are subsequently easier to catch. >=20 > Signed-off-by: Paul Cercueil Seems reasonable to me. Reviewed-by: Kieran Bingham > --- > Cc: Laurent Pinchart > Cc: Kieran Bingham > Cc: linux-renesas-soc@vger.kernel.org > --- > drivers/gpu/drm/rcar-du/rcar_du_drv.c | 9 +++------ > 1 file changed, 3 insertions(+), 6 deletions(-) >=20 > diff --git a/drivers/gpu/drm/rcar-du/rcar_du_drv.c b/drivers/gpu/drm/rcar= -du/rcar_du_drv.c > index a2776f1d6f2c..0a89094461cc 100644 > --- a/drivers/gpu/drm/rcar-du/rcar_du_drv.c > +++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.c > @@ -599,7 +599,6 @@ static const struct drm_driver rcar_du_driver =3D { > * Power management > */ > =20 > -#ifdef CONFIG_PM_SLEEP > static int rcar_du_pm_suspend(struct device *dev) > { > struct rcar_du_device *rcdu =3D dev_get_drvdata(dev); > @@ -613,11 +612,9 @@ static int rcar_du_pm_resume(struct device *dev) > =20 > return drm_mode_config_helper_resume(&rcdu->ddev); > } > -#endif > =20 > -static const struct dev_pm_ops rcar_du_pm_ops =3D { > - SET_SYSTEM_SLEEP_PM_OPS(rcar_du_pm_suspend, rcar_du_pm_resume) > -}; > +static DEFINE_SIMPLE_DEV_PM_OPS(rcar_du_pm_ops, > + rcar_du_pm_suspend, rcar_du_pm_resume); > =20 > /* ---------------------------------------------------------------------= -------- > * Platform driver > @@ -712,7 +709,7 @@ static struct platform_driver rcar_du_platform_driver= =3D { > .shutdown =3D rcar_du_shutdown, > .driver =3D { > .name =3D "rcar-du", > - .pm =3D &rcar_du_pm_ops, > + .pm =3D pm_sleep_ptr(&rcar_du_pm_ops), > .of_match_table =3D rcar_du_of_table, > }, > }; > --=20 > 2.35.1 >