From patchwork Thu Aug 4 05:04:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 73237 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp1203057qga; Wed, 3 Aug 2016 22:11:22 -0700 (PDT) X-Received: by 10.98.33.72 with SMTP id h69mr121790884pfh.28.1470287482122; Wed, 03 Aug 2016 22:11:22 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e184si12647618pfa.193.2016.08.03.22.11.21; Wed, 03 Aug 2016 22:11:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754265AbcHDFLU (ORCPT + 14 others); Thu, 4 Aug 2016 01:11:20 -0400 Received: from mail-pa0-f47.google.com ([209.85.220.47]:32927 "EHLO mail-pa0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751446AbcHDFLT (ORCPT ); Thu, 4 Aug 2016 01:11:19 -0400 Received: by mail-pa0-f47.google.com with SMTP id ti13so1760775pac.0 for ; Wed, 03 Aug 2016 22:11:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=kuxDA6AfEWIeB3qvm9xvL2GDEo1FVSM4A4+LbxQiw1I=; b=ZLObPbbboTabfrsOVW1wWFPRyWPgcgbgWu9n6Cd8vh7zmWDwJMQfrgN9VOINHgqB3h DVSK9JS06cTOCzOm+8UKWfNjpmSbl+b2H8yn/VTLQ55C3dg/ZuwbIm/FjSZuw1xwMOom FBj0yK8ej8QvB6reElmJYpTF9W0mqg2WNY484= 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:in-reply-to :references; bh=kuxDA6AfEWIeB3qvm9xvL2GDEo1FVSM4A4+LbxQiw1I=; b=edm9DpODMsAQZz2gw8JaINaGI0Thmjp8sx9D9jeBO4f2bN4HUYBv6i63XQ2brEDuka Q9Qjt9Z4eeg/jPulfgzP5TuaHQ4jodZnS+IWqJD36hakxsNTkijlB7uxcWTPRP0FMYnm akyFggbVuX7WXyTzCQFgB6i3mlM2OHZeT01RHqPcNG0yGaJrCY1vMjc4HwsH/rg9RMcR cTwVP4usamQgft0PgFdfOzGlz4BfDFtkCFCiyAWfoGByQNvbdsV7q2iUUC3NP1C9pYSc +YO+2KsxoBFM3Kh5OPoe8VpQrz8pt1yXnZp8kY+Ps15mKYDrvBXYE60ufuMWej6SzCUp tsHg== X-Gm-Message-State: AEkooutW03X36KTrgRkBqEwibMCSo57fz1NsmeTgpQs+dfiqNltx2TU/W+qjn7d5U3Qg4Z0q X-Received: by 10.66.229.9 with SMTP id sm9mr122129214pac.138.1470287050680; Wed, 03 Aug 2016 22:04:10 -0700 (PDT) Received: from localhost.localdomain (ip68-111-223-48.sd.sd.cox.net. [68.111.223.48]) by smtp.gmail.com with ESMTPSA id e68sm16339277pfk.1.2016.08.03.22.04.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 03 Aug 2016 22:04:10 -0700 (PDT) From: Bjorn Andersson To: Sebastian Reichel , Dmitry Eremin-Solenikov , David Woodhouse , John Stultz Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Subject: [PATCH 2/2] power: reset: syscon-reboot-mode: Use managed resource API Date: Wed, 3 Aug 2016 22:04:06 -0700 Message-Id: <1470287046-17437-2-git-send-email-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1470287046-17437-1-git-send-email-bjorn.andersson@linaro.org> References: <1470287046-17437-1-git-send-email-bjorn.andersson@linaro.org> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Use the managed resource version of reboot_mode_register(). Cc: John Stultz Signed-off-by: Bjorn Andersson --- John, here's a "pointer" to what I meant with my comment on your sram-reboot-mode patch. Only compile tested though. drivers/power/reset/syscon-reboot-mode.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) -- 2.5.0 -- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/power/reset/syscon-reboot-mode.c b/drivers/power/reset/syscon-reboot-mode.c index 9e1cba5dd58e..1ecb51d67149 100644 --- a/drivers/power/reset/syscon-reboot-mode.c +++ b/drivers/power/reset/syscon-reboot-mode.c @@ -53,8 +53,6 @@ static int syscon_reboot_mode_probe(struct platform_device *pdev) syscon_rbm->reboot.write = syscon_reboot_mode_write; syscon_rbm->mask = 0xffffffff; - dev_set_drvdata(&pdev->dev, syscon_rbm); - syscon_rbm->map = syscon_node_to_regmap(pdev->dev.parent->of_node); if (IS_ERR(syscon_rbm->map)) return PTR_ERR(syscon_rbm->map); @@ -65,20 +63,13 @@ static int syscon_reboot_mode_probe(struct platform_device *pdev) of_property_read_u32(pdev->dev.of_node, "mask", &syscon_rbm->mask); - ret = reboot_mode_register(&syscon_rbm->reboot); + ret = devm_reboot_mode_register(&pdev->dev, &syscon_rbm->reboot); if (ret) dev_err(&pdev->dev, "can't register reboot mode\n"); return ret; } -static int syscon_reboot_mode_remove(struct platform_device *pdev) -{ - struct syscon_reboot_mode *syscon_rbm = dev_get_drvdata(&pdev->dev); - - return reboot_mode_unregister(&syscon_rbm->reboot); -} - static const struct of_device_id syscon_reboot_mode_of_match[] = { { .compatible = "syscon-reboot-mode" }, {} @@ -86,7 +77,6 @@ static const struct of_device_id syscon_reboot_mode_of_match[] = { static struct platform_driver syscon_reboot_mode_driver = { .probe = syscon_reboot_mode_probe, - .remove = syscon_reboot_mode_remove, .driver = { .name = "syscon-reboot-mode", .of_match_table = syscon_reboot_mode_of_match,