From patchwork Sat Sep 21 14:11:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 2922461 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E03149F23C for ; Sat, 21 Sep 2013 14:12:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2D4D7204E1 for ; Sat, 21 Sep 2013 14:12:59 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 32EB3204DE for ; Sat, 21 Sep 2013 14:12:58 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VNNvC-0000pR-Ud; Sat, 21 Sep 2013 14:12:31 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VNNv5-0000SH-TJ; Sat, 21 Sep 2013 14:12:23 +0000 Received: from top.free-electrons.com ([176.31.233.9] helo=mail.free-electrons.com) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VNNuz-0000R8-IP for linux-arm-kernel@lists.infradead.org; Sat, 21 Sep 2013 14:12:18 +0000 Received: by mail.free-electrons.com (Postfix, from userid 106) id 03F7C8C0; Sat, 21 Sep 2013 16:12:01 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from localhost (wsip-98-172-55-39.no.no.cox.net [98.172.55.39]) by mail.free-electrons.com (Postfix) with ESMTPSA id 4992D8B9; Sat, 21 Sep 2013 16:12:01 +0200 (CEST) From: Maxime Ripard To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 2/2] ARM: sunxi: Simplify restart setup code Date: Sat, 21 Sep 2013 09:11:46 -0500 Message-Id: <1379772706-7028-2-git-send-email-maxime.ripard@free-electrons.com> X-Mailer: git-send-email 1.8.4 In-Reply-To: <1379772706-7028-1-git-send-email-maxime.ripard@free-electrons.com> References: <1379772706-7028-1-git-send-email-maxime.ripard@free-electrons.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130921_101217_795325_48F56546 X-CRM114-Status: GOOD ( 11.11 ) X-Spam-Score: -1.9 (-) Cc: Emilio Lopez , cinifr@gmail.com, Maxime Ripard X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Now that we have different machine definitions for different SoCs, we can remove the DT lookup to get the restart hook we should be using, and hardcode it in the machine definition instead. Signed-off-by: Maxime Ripard --- arch/arm/mach-sunxi/sunxi.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/arch/arm/mach-sunxi/sunxi.c b/arch/arm/mach-sunxi/sunxi.c index e0641dd..f184f6c 100644 --- a/arch/arm/mach-sunxi/sunxi.c +++ b/arch/arm/mach-sunxi/sunxi.c @@ -93,14 +93,13 @@ static void sun6i_restart(enum reboot_mode mode, const char *cmd) } static struct of_device_id sunxi_restart_ids[] = { - { .compatible = "allwinner,sun4i-wdt", .data = sun4i_restart }, - { .compatible = "allwinner,sun6i-wdt", .data = sun6i_restart }, + { .compatible = "allwinner,sun4i-wdt" }, + { .compatible = "allwinner,sun6i-wdt" }, { /*sentinel*/ } }; static void sunxi_setup_restart(void) { - const struct of_device_id *of_id; struct device_node *np; np = of_find_matching_node(NULL, sunxi_restart_ids); @@ -109,11 +108,6 @@ static void sunxi_setup_restart(void) wdt_base = of_iomap(np, 0); WARN(!wdt_base, "failed to map watchdog base address"); - - of_id = of_match_node(sunxi_restart_ids, np); - WARN(!of_id, "restart function not available"); - - arm_pm_restart = of_id->data; } static void __init sunxi_timer_init(void) @@ -140,6 +134,7 @@ DT_MACHINE_START(SUNXI_DT, "Allwinner A1X (Device Tree)") .init_machine = sunxi_dt_init, .init_time = sunxi_timer_init, .dt_compat = sunxi_board_dt_compat, + .restart = sun4i_restart, MACHINE_END static const char * const sun6i_board_dt_compat[] = { @@ -151,6 +146,7 @@ DT_MACHINE_START(SUN6I_DT, "Allwinner sun6i (A31) Family") .init_machine = sunxi_dt_init, .init_time = sunxi_timer_init, .dt_compat = sun6i_board_dt_compat, + .restart = sun6i_restart, MACHINE_END static const char * const sun7i_board_dt_compat[] = { @@ -162,4 +158,5 @@ DT_MACHINE_START(SUN7I_DT, "Allwinner sun7i (A20) Family") .init_machine = sunxi_dt_init, .init_time = sunxi_timer_init, .dt_compat = sun7i_board_dt_compat, + .restart = sun4i_restart, MACHINE_END