Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1488973rwb; Tue, 29 Nov 2022 14:27:01 -0800 (PST) X-Google-Smtp-Source: AA0mqf6j3yN5h2++WiKRbcqmMDvzg4sLmepOlUKYoea3oq4P7Z/s9F93JthnM8rx8ufvvrT3uezA X-Received: by 2002:a17:906:a094:b0:7ad:88f8:761f with SMTP id q20-20020a170906a09400b007ad88f8761fmr46954805ejy.417.1669760820919; Tue, 29 Nov 2022 14:27:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669760820; cv=none; d=google.com; s=arc-20160816; b=lQTW/BApZgYAg1aI1dqrbwLXOujERWqISrf9MGyqdOASD/Q1MA52082dsasrr14df9 RcSPPKKMfjSjQBDsRVbkF4vU4joS0OmpkPhNTPcIv7gK+/eaJdUrh/MPxOTqxHFlUkzY 47nwFJXy1oBfn72nY8XK/zm+/8t9454mJftWOcliUC4jkdMJd6xqf9tSgmnaXR8HdzW8 r2D4tC1MkbNqfCN2tvm02RiXTK0277rXk3+0AqTf1BKWJf/9QynDXiBfCnJ3/ZIoW9PO uC0CRvKAD6fVU6D1FEKRXIN8+EwrvZzYuo8ckxUq100fznvXmsDTXq7pT9izU+EQDZs5 dAIQ== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=V4y6MPFIDRA6gabOkwwm8jy9JZytiNopfsGuOZiHPnw=; b=mSGE12oMi0PiTabns5fbfNuxzgACm7KerPevLtvoyOPsPuB1sgWvxlYIDVyrmFKB1X boPPrvRbbJu5CqCvftahVqOaQSPOVdiJp+UBghTcqeTala6W5todCvSFTfdwIOZLyp2V WVsHgr2hdu5vYooZ2YBuZlU6duQbwGdwN6ApygzPHjPtfmfJBLSly+egkclsby53fStA G/xZhV0WSsr+ZLeIV7WxwbQL+ePRH317qOgZKT7BWnfliNd39j49hS36wUHoqv1CsJDd UdOmtFsAk4YGf63OaRPoavUTBmS/6NrG8edvHNbTWGppoceAiNPDj5foD+0bePwaJtu/ pSJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=g3Zwjqkr; 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 be12-20020a1709070a4c00b007bea4cb6188si7435725ejc.634.2022.11.29.14.26.40; Tue, 29 Nov 2022 14:27:00 -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=g3Zwjqkr; 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 S236543AbiK2VZO (ORCPT + 84 others); Tue, 29 Nov 2022 16:25:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51834 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236072AbiK2VZM (ORCPT ); Tue, 29 Nov 2022 16:25:12 -0500 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 96A022873C; Tue, 29 Nov 2022 13:25:11 -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 D00644DA; Tue, 29 Nov 2022 22:25:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1669757109; bh=u5VM/EgB7yQMqQjQKF0CcQgsCgj+ZZXX6KbdTtfkuT0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=g3ZwjqkriwYHCxMWesQ0ByzkNYfTLdWCm8tmyxfMGUqIiqevMVNbn9uiCrhD6YX5P 9Vd11qKuBj3PzzokNrDjLjrA2bVQZ19vfDqcp6hjwKaLwNDa12GES+BkirgRAHstCZ v6jveB3IkZWPYC7gUKVgBnq+efaNOjJGNovYt3jY= Date: Tue, 29 Nov 2022 23:24:53 +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 Content-Transfer-Encoding: 8bit In-Reply-To: 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, On Tue, Nov 29, 2022 at 09:05:49PM +0000, Paul Cercueil wrote: > Le mardi 29 novembre 2022 à 21:43 +0200, Laurent Pinchart a écrit : > > 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 :-)). > > I actually answered that in my cover letter ;) Oops. I read until "V2" and didn't notice the last paragraph, sorry. > However I assumed it had to go through drm-next, if you think it can go > through drm-misc-next, I can apply it myself. This seems like a good candidate for drm-misc to 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