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: 9262689 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4973C60754 for ; Thu, 4 Aug 2016 05:11:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3067F27FA6 for ; Thu, 4 Aug 2016 05:11:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 22E4927FAC; Thu, 4 Aug 2016 05:11:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9401927FA6 for ; Thu, 4 Aug 2016 05:11:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754265AbcHDFLU (ORCPT ); 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 X-Virus-Scanned: ClamAV using ClamSMTP Use the managed resource version of reboot_mode_register(). Cc: John Stultz Signed-off-by: Bjorn Andersson Tested-by: John Stultz --- 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(-) 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,