From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753533AbcDOCmk (ORCPT ); Thu, 14 Apr 2016 22:42:40 -0400 Received: from bh-25.webhostbox.net ([208.91.199.152]:40869 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752962AbcDOCmg (ORCPT ); Thu, 14 Apr 2016 22:42:36 -0400 From: Guenter Roeck To: Russell King , Catalin Marinas Cc: Wolfram Sang , Geert Uytterhoeven , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Guenter Roeck , Barry Song Subject: [PATCH v2 1/6] ARM: prima2: Register with kernel restart handler Date: Thu, 14 Apr 2016 19:42:32 -0700 Message-Id: <1460688157-6551-2-git-send-email-linux@roeck-us.net> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1460688157-6551-1-git-send-email-linux@roeck-us.net> References: <1460688157-6551-1-git-send-email-linux@roeck-us.net> X-Authenticated_sender: guenter@roeck-us.net X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-Get-Message-Sender-Via: bh-25.webhostbox.net: authenticated_id: guenter@roeck-us.net X-Authenticated-Sender: bh-25.webhostbox.net: guenter@roeck-us.net X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Register with kernel restart handler instead of setting arm_pm_restart directly. By doing this, the prima2 reset handler can be prioritized among other restart methods available on a particular board. Select a high priority of 192 since the original code overwrites the default arm restart handler. Acked-by: Arnd Bergmann Reviewed-by: Wolfram Sang Signed-off-by: Guenter Roeck --- v2: Rebased to v4.6-rc3, added Reviewed/by/Acked-by tags arch/arm/mach-prima2/rstc.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-prima2/rstc.c b/arch/arm/mach-prima2/rstc.c index 7c251eb11d01..1639997c5b49 100644 --- a/arch/arm/mach-prima2/rstc.c +++ b/arch/arm/mach-prima2/rstc.c @@ -65,11 +65,18 @@ static struct reset_controller_dev sirfsoc_reset_controller = { #define SIRFSOC_SYS_RST_BIT BIT(31) -static void sirfsoc_restart(enum reboot_mode mode, const char *cmd) +static int sirfsoc_restart(struct notifier_block *nb, unsigned long action, + void *data) { writel(SIRFSOC_SYS_RST_BIT, sirfsoc_rstc_base); + return NOTIFY_DONE; } +static struct notifier_block sirfsoc_restart_nb = { + .notifier_call = sirfsoc_restart, + .priority = 192, +}; + static int sirfsoc_rstc_probe(struct platform_device *pdev) { struct device_node *np = pdev->dev.of_node; @@ -80,7 +87,7 @@ static int sirfsoc_rstc_probe(struct platform_device *pdev) } sirfsoc_reset_controller.of_node = np; - arm_pm_restart = sirfsoc_restart; + register_restart_handler(&sirfsoc_restart_nb); if (IS_ENABLED(CONFIG_RESET_CONTROLLER)) reset_controller_register(&sirfsoc_reset_controller); -- 2.5.0