Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1323649rwb; Tue, 29 Nov 2022 11:56:43 -0800 (PST) X-Google-Smtp-Source: AA0mqf6rPTjnUtbJil11aqBNPK+gwAmA4767BzvaZ2skJKynFmz372q8VZf2bfWOPz8vGLpX8oc4 X-Received: by 2002:a05:6402:5513:b0:467:7026:515e with SMTP id fi19-20020a056402551300b004677026515emr53702230edb.26.1669751803581; Tue, 29 Nov 2022 11:56:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669751803; cv=none; d=google.com; s=arc-20160816; b=ueJ4USCrBv5q0nVJjO+xMCKGSEGgl1Hw0Q34HoZBqrGkr8JqAREGDGrCVyexziAFAA 4MEUx/7e2xoxEGE552uhSrux8RpeMPXhSSgQD22pQkuizfOJU6Zly5Mw73+MjilGSfPI QBFhk5w/oFhBmqJN54cYfO/2MXlsX29/h9TA9gTM7pzBTGDQd2HpAm79r+DVwZI509nF AZdx8L71bV4uHNfDApqR5EQSP5VewgTxEpZ2SdNxDKXpgUeZas/AnPmbxD4A1wl2Fp+5 SpokYqdXP5iutHbXvdd0Veb1bFhJBKnMEffuBA2bL9sCOWP7bR40Y2w2Xz2CFVA1SBtA Viag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=FrUEDnz0tuKAvF82mytf/5PMj6efiejeyi1AgblCq2Q=; b=GaMVyn+p3nlJzMLw6xzCOyPaqnchUj9Hu60ip1A7E7Jo1p5LNatRfA6RJlMgywFRrK 0A5VdL8dOeMFtxQK5x0zxhx5CQ1+0H3GuLFoVLFGPdouS9SN27Rd0u5KdTjfung9cfU+ gwdVfGaDNtn8JxR8TQv1iGjMI4Y8LRx8B0mI6m6UEP2UQJVI4HFTE1Eghpcf8K1xGPMr NV8dPOSneCgikoTNyfCH8x5kkQ6dD3pvYGUbSvgXuz6iTqFT76dyeu1gyfXZG1/ryqWV hbl1XFSsABaAnqlSEyTJ0J70nwksPDWYqdENA8Bye4O6PUkful7rcqR2cTnSBrpbLdJa PW/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=aeRIvdSC; 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 h28-20020a0564020e9c00b0046b850e46d1si1682331eda.145.2022.11.29.11.56.21; Tue, 29 Nov 2022 11:56:43 -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=aeRIvdSC; 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 S236480AbiK2Trr (ORCPT + 84 others); Tue, 29 Nov 2022 14:47:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237185AbiK2TrE (ORCPT ); Tue, 29 Nov 2022 14:47:04 -0500 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D701B63A7; Tue, 29 Nov 2022 11:44:09 -0800 (PST) Received: from pendragon.ideasonboard.com (213-243-189-158.bb.dnainternet.fi [213.243.189.158]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 8C8364E6; Tue, 29 Nov 2022 20:44:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1669751047; bh=pUu+g5t3BnVNUh+Ojo6e6Lwl1K0PG+/VdnlmN/8ik+U=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=aeRIvdSC4NFh/T3Ubi8FCUtqi/tUYQH1c3ZwlAd7UTNpMRYKJdRORyDXTyroKaLE+ R2ERdl+K6v9BL8Z+W/Sw5XjwjvqDilv/RUrk86kIkXK0Vv45T1JoeUSMYSsEUgIO02 oRkymguTTUmcY8aePq66PydpxDYIEopsTdN2WrrM= Date: Tue, 29 Nov 2022 21:43:51 +0200 From: Laurent Pinchart To: Paul Cercueil Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Kieran Bingham , linux-renesas-soc@vger.kernel.org Subject: Re: [PATCH v2 17/26] drm: rcar-du: Remove #ifdef guards for PM related functions Message-ID: References: <20221129191733.137897-1-paul@crapouillou.net> <20221129191942.138244-1-paul@crapouillou.net> <20221129191942.138244-4-paul@crapouillou.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20221129191942.138244-4-paul@crapouillou.net> 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 Hi Paul, Thank you for the patch. On Tue, Nov 29, 2022 at 07:19:33PM +0000, Paul Cercueil wrote: > Use the DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() macros to handle > the .suspend/.resume callbacks. > > 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. > > 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. > > Signed-off-by: Paul Cercueil > Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart Will you get this whole series merged in one go in drm-misc, or do you expect me to take this patch in my tree ? I'd prefer the first option if possible (less work for me :-)). > --- > 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(-) > > diff --git a/drivers/gpu/drm/rcar-du/rcar_du_drv.c b/drivers/gpu/drm/rcar-du/rcar_du_drv.c > index d003e8d9e7a2..eeec1e02446f 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 = { > * Power management > */ > > -#ifdef CONFIG_PM_SLEEP > static int rcar_du_pm_suspend(struct device *dev) > { > struct rcar_du_device *rcdu = dev_get_drvdata(dev); > @@ -613,11 +612,9 @@ static int rcar_du_pm_resume(struct device *dev) > > return drm_mode_config_helper_resume(&rcdu->ddev); > } > -#endif > > -static const struct dev_pm_ops rcar_du_pm_ops = { > - 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); > > /* ----------------------------------------------------------------------------- > * Platform driver > @@ -712,7 +709,7 @@ static struct platform_driver rcar_du_platform_driver = { > .shutdown = rcar_du_shutdown, > .driver = { > .name = "rcar-du", > - .pm = &rcar_du_pm_ops, > + .pm = pm_sleep_ptr(&rcar_du_pm_ops), > .of_match_table = rcar_du_of_table, > }, > }; -- Regards, Laurent Pinchart