Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2164871rwb; Mon, 7 Nov 2022 09:54:56 -0800 (PST) X-Google-Smtp-Source: AMsMyM5R+kHoV/yXsWsbBdjik26HSYG2NWiHnD2QXtnu/Sfyu+uLyiKuVVIXR8pqvpBycuEJrg7i X-Received: by 2002:a05:6a00:1d06:b0:56b:ec38:27e9 with SMTP id a6-20020a056a001d0600b0056bec3827e9mr50845273pfx.71.1667843695869; Mon, 07 Nov 2022 09:54:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667843695; cv=none; d=google.com; s=arc-20160816; b=NHDNP4ovWchK19PMz3NrYrgz/jCEnlJ1SOfmZ1iP+X3gpuJw0q0Rlzl+cNVjRZrj+d kXsiVKjATNGqmTTJwgkWyfWx8ab+OPaVwaMxOph34PXTBbpTSkVKqb/az144GbJIDDa0 4oWSot6VK46zZugxlwKQ266q/YUAXQujQvMCKrrRICZXbnQnpUJs7gnHhxfgUtmM3dBs jHjtONTT/6AgkcPXXTGzWqaakAFvHhjyk4fpwwTTETMBUFGvx+Uwo35SjnYrxEuEIIiZ YNTk1fthuzvwH9asySUCLv/gCjPSiGGYOw9qiiiAhf5RGFA0bqJAYFhVamU2w3c1oxQB 7CGw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=klnnbpNcTKD/P5BEtITlZwIsXZ1Fq0oNl7HLfIen9u4=; b=AGdxYMa2xh8A908w8E/xFkX0HGeT4/GWa5FiE85BZtQnNTBwmf3mQLTcUnJsxtL4LL UqXKD8h1r+scsyw+6QuZ4ILB7IGh7WQE6Lh0NeWizKoZNgiYN5VTSzQHlgQ4wN9NPpp0 ZLvBG/4NgcRziMw/HTfCkOdvG2Mh8DJEZmvIOdyt/4cqhP09eNgrzWkQcRPXy7TK6tOf gZZoLvfsTvFeGhnNXpV0WgSWCSXCGAPI0/syKjaoitwS0tzeL/pc1BTzKqxrrwToiCoo PnduJVogF7JG+b5bZLnYF0QI3JkcKPqlkWVFF79S2CbMAGfKo0TGoRbCeVRiv+W00jW+ 8I5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b=XNVJToum; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u14-20020a63790e000000b0046eecbac482si11280296pgc.415.2022.11.07.09.54.43; Mon, 07 Nov 2022 09:54:55 -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 header.i=@crapouillou.net header.s=mail header.b=XNVJToum; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232226AbiKGRwB (ORCPT + 92 others); Mon, 7 Nov 2022 12:52:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57732 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232258AbiKGRvt (ORCPT ); Mon, 7 Nov 2022 12:51:49 -0500 Received: from aposti.net (aposti.net [89.234.176.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EDA1B23BCD; Mon, 7 Nov 2022 09:51:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1667843476; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=klnnbpNcTKD/P5BEtITlZwIsXZ1Fq0oNl7HLfIen9u4=; b=XNVJToum7O1ELLYtHELKa6DULsTzDus/PRW8z07zFik0Yu88BO8U7l2dptcwi44DFmKvCJ sPuN3hW1dlmJjaokQ9uTtYs2cAzqgIy2DG9zjSZmHBdycVP9duTQ44DQD/VNBt3J5IXXKf 7TrK1+e02tHDPjCnGIVQYl8ybDPhN4w= From: Paul Cercueil To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Paul Cercueil , Thierry Reding , Jonathan Hunter , linux-tegra@vger.kernel.org Subject: [PATCH 05/26] drm: tegra: Use the dev_pm_ops provided by modeset helper Date: Mon, 7 Nov 2022 17:50:45 +0000 Message-Id: <20221107175106.360578-6-paul@crapouillou.net> In-Reply-To: <20221107175106.360578-1-paul@crapouillou.net> References: <20221107175106.360578-1-paul@crapouillou.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam: Yes 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 Use the drm_mode_config_pm_ops structure exported by drm_modeset_helper.c, which provides the exact same PM callbacks. Signed-off-by: Paul Cercueil --- Cc: Thierry Reding Cc: Jonathan Hunter Cc: linux-tegra@vger.kernel.org --- drivers/gpu/drm/tegra/drm.c | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c index 6748ec1e0005..c9b6b3acb8c7 100644 --- a/drivers/gpu/drm/tegra/drm.c +++ b/drivers/gpu/drm/tegra/drm.c @@ -1325,25 +1325,6 @@ static int host1x_drm_remove(struct host1x_device *dev) return 0; } -#ifdef CONFIG_PM_SLEEP -static int host1x_drm_suspend(struct device *dev) -{ - struct drm_device *drm = dev_get_drvdata(dev); - - return drm_mode_config_helper_suspend(drm); -} - -static int host1x_drm_resume(struct device *dev) -{ - struct drm_device *drm = dev_get_drvdata(dev); - - return drm_mode_config_helper_resume(drm); -} -#endif - -static SIMPLE_DEV_PM_OPS(host1x_drm_pm_ops, host1x_drm_suspend, - host1x_drm_resume); - static const struct of_device_id host1x_drm_subdevs[] = { { .compatible = "nvidia,tegra20-dc", }, { .compatible = "nvidia,tegra20-hdmi", }, @@ -1388,7 +1369,7 @@ static const struct of_device_id host1x_drm_subdevs[] = { static struct host1x_driver host1x_drm_driver = { .driver = { .name = "drm", - .pm = &host1x_drm_pm_ops, + .pm = pm_sleep_ptr(&drm_mode_config_pm_ops), }, .probe = host1x_drm_probe, .remove = host1x_drm_remove, -- 2.35.1