Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp3395519pxb; Mon, 6 Sep 2021 21:06:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzly6Gf0HlPgHidtM32usJ737aJzkI+gBf6tyekZqOxG58lmEYpWHsVZbjbRWKAQLeH2+Gs X-Received: by 2002:a05:6402:1913:: with SMTP id e19mr16281989edz.9.1630987569076; Mon, 06 Sep 2021 21:06:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630987569; cv=none; d=google.com; s=arc-20160816; b=D83Jn4SYq8LMsfmywwBcko7kv54DhOBWavQZrUEQMfYLCBje8ewNcW4VoMOzHBkZcT PrVvRJ6nW4RYs1W93/MMYAgGZjLiqO3ayG8Xs14hPdEuhAsDG6sBACLl3qsRXDIVjmP/ WKeXGfcG47XjzLGJEElUu0aFrvbh6fUeT4K2hQoXk+uLF5j6eO6zaABgwPNYp87xTyJ8 13kyYcrjspiUrW+T2g3+OVc/eVUYysiLTjmR4swaHaULx02NlfrA8IuV/VwrdpWq/54C wjUkUIln6BEONliUQ7c5qVZEavxkRVfqSqMYP57fg5kQ0brBXS5BqVeqAtt/FCgMp9qw 0/JA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=Op1kdWc1GVHEmARqf0MGO/3hOiq22M4eerJBT4nS73A=; b=fcfRUs9GBGOEATNtw+cx8XugvhcNURhQiXan9Cs1manwtizLs2tq98ox4k/5d6vYba LgVgWAzRboUxxzkkG5BkfWpJM5niDa4ERwdjsctyVShWkdR5YBA44K0mrg3J9bI4Kq6Q j3Nrgy0b4HT4XJiytNtW0PAcFw+aPOnyitGE4tiumh9nt59UJ0oElQLXzr7uyc3RBMne d279BUEXE8DQZVR6XmOfK1fbWJ9V7n3JVfNQ36UcNESD/UKY6SwpOPKR5CC/Sd6QYwrj VhhJ+4z1nPmylNRB1YSp4lanu6JaVNGR9oHgNEQ0B4mihkfXDwRr6o7KA/42D2pey8P/ D5MA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e18si9203186ejj.656.2021.09.06.21.05.19; Mon, 06 Sep 2021 21:06:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233171AbhIGDgm (ORCPT + 99 others); Mon, 6 Sep 2021 23:36:42 -0400 Received: from mx20.baidu.com ([111.202.115.85]:39302 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230133AbhIGDgm (ORCPT ); Mon, 6 Sep 2021 23:36:42 -0400 Received: from BJHW-Mail-Ex12.internal.baidu.com (unknown [10.127.64.35]) by Forcepoint Email with ESMTPS id C0CA7751C5B3C291EAE1; Tue, 7 Sep 2021 11:35:32 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BJHW-Mail-Ex12.internal.baidu.com (10.127.64.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Tue, 7 Sep 2021 11:35:32 +0800 Received: from LAPTOP-UKSR4ENP.internal.baidu.com (172.31.63.8) by BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Tue, 7 Sep 2021 11:35:32 +0800 From: Cai Huoqing To: CC: Jyri Sarha , Tomi Valkeinen , "David Airlie" , Daniel Vetter , , Subject: [PATCH v2] drm/tidss: Make use of the helper macro SET_RUNTIME_PM_OPS() Date: Tue, 7 Sep 2021 11:35:26 +0800 Message-ID: <20210907033526.1612-1-caihuoqing@baidu.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.31.63.8] X-ClientProxiedBy: BJHW-Mail-Ex05.internal.baidu.com (10.127.64.15) To BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) X-Baidu-BdMsfe-DateCheck: 1_BJHW-Mail-Ex12_2021-09-07 11:35:32:812 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use the helper macro SET_RUNTIME_PM_OPS() instead of the verbose operators ".runtime_suspend/.runtime_resume", because the SET_RUNTIME_PM_OPS() is a nice helper macro that could be brought in to make code a little more concise. Signed-off-by: Cai Huoqing --- v1->v2: *Remove "#ifdef CONFIG_PM" around around runtime_suspend|resume(). *Make use of pm_ptr() in the assignment in tidss_platform_driver. v1 comments link: https://www.spinics.net/lists/dri-devel/msg313178.html drivers/gpu/drm/tidss/tidss_drv.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/tidss/tidss_drv.c b/drivers/gpu/drm/tidss/tidss_drv.c index d620f35688da..4366b5c798e0 100644 --- a/drivers/gpu/drm/tidss/tidss_drv.c +++ b/drivers/gpu/drm/tidss/tidss_drv.c @@ -88,16 +88,11 @@ static int __maybe_unused tidss_resume(struct device *dev) return drm_mode_config_helper_resume(&tidss->ddev); } -#ifdef CONFIG_PM - static const struct dev_pm_ops tidss_pm_ops = { - .runtime_suspend = tidss_pm_runtime_suspend, - .runtime_resume = tidss_pm_runtime_resume, SET_SYSTEM_SLEEP_PM_OPS(tidss_suspend, tidss_resume) + SET_RUNTIME_PM_OPS(tidss_pm_runtime_suspend, tidss_pm_runtime_resume, NULL) }; -#endif /* CONFIG_PM */ - /* DRM device Information */ static void tidss_release(struct drm_device *ddev) @@ -250,9 +245,7 @@ static struct platform_driver tidss_platform_driver = { .shutdown = tidss_shutdown, .driver = { .name = "tidss", -#ifdef CONFIG_PM - .pm = &tidss_pm_ops, -#endif + .pm = pm_ptr(&tidss_pm_ops), .of_match_table = tidss_of_table, .suppress_bind_attrs = true, }, -- 2.25.1