From patchwork Mon Feb 2 16:33:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Grygorii.Strashko@linaro.org" X-Patchwork-Id: 5763101 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 94A1FBF440 for ; Mon, 2 Feb 2015 16:33:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 445B7206EC for ; Mon, 2 Feb 2015 16:33:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2294B206E8 for ; Mon, 2 Feb 2015 16:33:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932512AbbBBQdM (ORCPT ); Mon, 2 Feb 2015 11:33:12 -0500 Received: from mail-la0-f51.google.com ([209.85.215.51]:45366 "EHLO mail-la0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932233AbbBBQdL (ORCPT ); Mon, 2 Feb 2015 11:33:11 -0500 Received: by mail-la0-f51.google.com with SMTP id ge10so42787332lab.10 for ; Mon, 02 Feb 2015 08:33:10 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=RnBdWhCZP5q2SGhOfFeTRnwtgL/JE1av3ISjX1vTSBA=; b=ECsy7xe9bLTZAhrFkPMwJjlQZExY8cjEzUWfcPZ2SQb4vpJydC46V+5iVjn/Md2zBp mXtQJBT19PyLi7X8DoAy5okJBpRvpk5gntz2upmrgGY4PbFTXo2Pz0hjxj94u/5NL2i7 e5F4U0hBxf0L0cd4WaOm6s1GYVqiwaguL752QPg2E7TFpInRZIMZ0LmE5mxw//2+N5X8 BKaOH4Qa2+KDMpWKUwWmM0Asj2o/HUiSu7hzc7NpRrw9yW+Jny3NGLYMtHSRhn7ZaRrU AZvYMAPTmElxdddPzfgKaGrLNOF+ahP7OPfX1qDvPTAQC37YEAyuH+uW1zPQ4G9ii2lY GZFA== X-Gm-Message-State: ALoCoQkZ0ZOdDjkOjmCfG4Ujx0eTTXsYJBvVV4shDo18hNUQsEe5Xt0C6DY5vUZLwrXCpgVUjGC6 X-Received: by 10.152.26.98 with SMTP id k2mr20622430lag.53.1422894790238; Mon, 02 Feb 2015 08:33:10 -0800 (PST) Received: from localhost ([195.238.92.128]) by mx.google.com with ESMTPSA id rn9sm1708357lbb.23.2015.02.02.08.33.09 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 02 Feb 2015 08:33:09 -0800 (PST) From: To: Bryan Wu , Richard Purdie , linux-leds@vger.kernel.org Cc: sumit.semwal@linaro.org, linux-arm-kernel@lists.infradead.org, , linux-pm@vger.kernel.org, Grygorii Strashko Subject: [PATCH] leds: add hibernation callbacks Date: Mon, 2 Feb 2015 18:33:06 +0200 Message-Id: <1422894786-23353-1-git-send-email-grygorii.strashko@linaro.org> X-Mailer: git-send-email 1.9.1 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Grygorii Strashko Setting a dev_pm_ops suspend/resume pair of callbacks but not a set of hibernation callbacks means those pm functions will not be called upon hibernation - that leads to system crash on ARM during freezing if gpio-led is used in combination with CPU led trigger. It may happen after freeze_noirq stage (GPIO is suspended) and before syscore_suspend stage (CPU led trigger is suspended) - usually when disable_nonboot_cpus() is called. Fix this by using SIMPLE_DEV_PM_OPS, which appropriately assigns the suspend and hibernation callbacks. Signed-off-by: Grygorii Strashko --- drivers/leds/led-class.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/leds/led-class.c b/drivers/leds/led-class.c index f37d63c..4c03808 100644 --- a/drivers/leds/led-class.c +++ b/drivers/leds/led-class.c @@ -198,10 +198,7 @@ static int led_resume(struct device *dev) return 0; } -static const struct dev_pm_ops leds_class_dev_pm_ops = { - .suspend = led_suspend, - .resume = led_resume, -}; +static SIMPLE_DEV_PM_OPS(leds_class_dev_pm_ops, led_suspend, led_resume); /** * led_classdev_register - register a new object of led_classdev class.