From patchwork Tue Mar 24 12:15:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 46304 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f71.google.com (mail-wg0-f71.google.com [74.125.82.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D9A9D2159D for ; Wed, 25 Mar 2015 03:27:13 +0000 (UTC) Received: by wghb13 with SMTP id b13sf1971495wgh.3 for ; Tue, 24 Mar 2015 20:27:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:delivered-to:from:to:subject:date :message-id:in-reply-to:references:mime-version:cc:precedence :list-id:list-unsubscribe:list-archive:list-post:list-help :list-subscribe:content-type:content-transfer-encoding:errors-to :sender:x-original-sender:x-original-authentication-results :mailing-list; bh=t1VbSU5zTnl+bVMO+/ZKRBkSbU6Hty7jauFabyehL7g=; b=TdRuQpUo7t5Ixh9EsGDnMq/6Sd7GykDGtGeRweCo1x2qVoi0+b/9JW7qD/thRyo/u4 kn6BpT3fgUEvSkvJhKnOkCIbyLJDPVjKW8d1GYK0dvObeAqPr7INaF74W3pv6qX+AgqE S+bamShYem7txD8QoA0dXG7Lo/DDbS2Q3cV1tsIwHQYEGeaAa+GNpHukoMcA2dS2Gufz kJR0z6111LxjgOtbltZIyOmiNboQtkw7ctjCLsuWx+0myZ3/C8G9bYcYxOHukso9+kLM jmtQIlqqy1XCeeR+iOy5w9bznmaAjIYfoBPEknHV51S8M2CsnfyfwvgMavEOi3jlDL4n nBVw== X-Gm-Message-State: ALoCoQnEvG426u93PbWUyOthndecnjrzbFCcfgGDzRJkeMy0FcWL4jVbdO0RJTZN0pG3cB6Tfx3k X-Received: by 10.181.29.66 with SMTP id ju2mr3771901wid.1.1427254033212; Tue, 24 Mar 2015 20:27:13 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.29.225 with SMTP id n1ls46161lah.52.gmail; Tue, 24 Mar 2015 20:27:13 -0700 (PDT) X-Received: by 10.152.27.39 with SMTP id q7mr6251341lag.49.1427254033041; Tue, 24 Mar 2015 20:27:13 -0700 (PDT) Received: from mail-la0-f46.google.com (mail-la0-f46.google.com. [209.85.215.46]) by mx.google.com with ESMTPS id q8si881504lah.51.2015.03.24.20.27.12 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Mar 2015 20:27:12 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.46 as permitted sender) client-ip=209.85.215.46; Received: by labe2 with SMTP id e2so9570197lab.3 for ; Tue, 24 Mar 2015 20:27:12 -0700 (PDT) X-Received: by 10.152.120.134 with SMTP id lc6mr6421069lab.72.1427254032618; Tue, 24 Mar 2015 20:27:12 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.57.201 with SMTP id k9csp1832006lbq; Tue, 24 Mar 2015 20:27:11 -0700 (PDT) X-Received: by 10.68.165.65 with SMTP id yw1mr12480283pbb.163.1427253675052; Tue, 24 Mar 2015 20:21:15 -0700 (PDT) Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTP id ri8si1537627pbc.225.2015.03.24.20.21.14; Tue, 24 Mar 2015 20:21:15 -0700 (PDT) Received-SPF: none (google.com: dri-devel-bounces@lists.freedesktop.org does not designate permitted sender hosts) client-ip=131.252.210.177; Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 40989720C2; Tue, 24 Mar 2015 20:20:56 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from devils.ext.ti.com (devils.ext.ti.com [198.47.26.153]) by gabe.freedesktop.org (Postfix) with ESMTP id AE7186E6BF for ; Tue, 24 Mar 2015 05:17:00 -0700 (PDT) Received: from dflxv15.itg.ti.com ([128.247.5.124]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id t2OCGv9S007826; Tue, 24 Mar 2015 07:16:57 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id t2OCGuoA003470; Tue, 24 Mar 2015 07:16:56 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.224.2; Tue, 24 Mar 2015 07:16:56 -0500 Received: from deskari.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id t2OCGCXk032032; Tue, 24 Mar 2015 07:16:55 -0500 From: Tomi Valkeinen To: Subject: [PATCH 35/36] drm/omap: add hibernation callbacks Date: Tue, 24 Mar 2015 14:15:52 +0200 Message-ID: <1427199353-4412-36-git-send-email-tomi.valkeinen@ti.com> X-Mailer: git-send-email 2.3.3 In-Reply-To: <1427199353-4412-1-git-send-email-tomi.valkeinen@ti.com> References: <1427199353-4412-1-git-send-email-tomi.valkeinen@ti.com> MIME-Version: 1.0 X-Mailman-Approved-At: Tue, 24 Mar 2015 20:20:48 -0700 Cc: Tomi Valkeinen , Grygorii Strashko , Laurent Pinchart X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: tomi.valkeinen@ti.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.46 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Grygorii Strashko Setting a dev_pm_ops suspend/resume pair but not a set of hibernation functions means those pm functions will not be called upon hibernation. Fix this by using SIMPLE_DEV_PM_OPS, which appropriately assigns the suspend and hibernation handlers and move omap_drm_suspend/omap_drm_resume under CONFIG_PM_SLEEP to avoid build warnings. Signed-off-by: Grygorii Strashko [tomi.valkeinen@ti.com: fix conflict, clean up description] Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/omapdrm/omap_drv.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c index c6980985884b..94920d47e3b6 100644 --- a/drivers/gpu/drm/omapdrm/omap_drv.c +++ b/drivers/gpu/drm/omapdrm/omap_drv.c @@ -707,6 +707,7 @@ static int pdev_remove(struct platform_device *device) return 0; } +#ifdef CONFIG_PM_SLEEP static int omap_drm_suspend(struct device *dev) { struct drm_device *drm_dev = dev_get_drvdata(dev); @@ -724,20 +725,14 @@ static int omap_drm_resume(struct device *dev) return omap_gem_resume(dev); } - -#ifdef CONFIG_PM -static const struct dev_pm_ops omapdrm_pm_ops = { - .suspend = omap_drm_suspend, - .resume = omap_drm_resume, -}; #endif +static SIMPLE_DEV_PM_OPS(omapdrm_pm_ops, omap_drm_suspend, omap_drm_resume); + static struct platform_driver pdev = { .driver = { .name = DRIVER_NAME, -#ifdef CONFIG_PM .pm = &omapdrm_pm_ops, -#endif }, .probe = pdev_probe, .remove = pdev_remove,