From patchwork Tue Jan 8 13:31:42 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pantelis Antoniou X-Patchwork-Id: 1945731 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 30C19DF23A for ; Tue, 8 Jan 2013 13:32:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756263Ab3AHNbs (ORCPT ); Tue, 8 Jan 2013 08:31:48 -0500 Received: from li42-95.members.linode.com ([209.123.162.95]:51740 "EHLO li42-95.members.linode.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755827Ab3AHNbs (ORCPT ); Tue, 8 Jan 2013 08:31:48 -0500 Received: from sles11esa.localdomain (unknown [195.97.110.117]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: panto) by li42-95.members.linode.com (Postfix) with ESMTPSA id D51DB9C0C3; Tue, 8 Jan 2013 13:31:44 +0000 (UTC) From: Pantelis Antoniou Cc: Tony Lindgren , Stephen Warren , Benoit Cousson , linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, Matt Porter , Russ Dill , Koen Kooi , Joel A Fernandes , Rob Clark , Jason Kridner , Matt Ranostay , Pantelis Antoniou Subject: [PATCH] omap: DT node Timer iteration fix Date: Tue, 8 Jan 2013 15:31:42 +0200 Message-Id: <1357651902-21966-1-git-send-email-panto@antoniou-consulting.com> X-Mailer: git-send-email 1.7.12 To: unlisted-recipients:; (no To-header on input) Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org The iterator correctly handles of_node_put() calls. Remove it before continue'ing the loop. Without this patch you get: ERROR: Bad of_node_put() on /ocp/timer@44e31000! [] (unwind_backtrace+0x0/0xe0) from [] (of_node_release+0x2c/0xa0)! [] (of_node_release+0x2c/0xa0) from [] (of_find_matching_node_and_match+0x78/0x90)! [] (of_find_matching_node_and_match+0x78/0x90) from [] (omap_get_timer_dt+0x78/0x90)! [] (omap_get_timer_dt+0x78/0x90) from [] (omap_dm_timer_init_one.clone.2+0x34/0x2bc)! [] (omap_dm_timer_init_one.clone.2+0x34/0x2bc) from [] (omap2_gptimer_clocksource_init.clone.4+0x24/0xa8)! [] (omap2_gptimer_clocksource_init.clone.4+0x24/0xa8) from [] (time_init+0x20/0x30)! [] (time_init+0x20/0x30) from [] (start_kernel+0x1a8/0x2fc)! Signed-off-by: Pantelis Antoniou Acked-by: Jon Hunter --- arch/arm/mach-omap2/timer.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c index 691aa67..b8ad6e6 100644 --- a/arch/arm/mach-omap2/timer.c +++ b/arch/arm/mach-omap2/timer.c @@ -165,15 +165,11 @@ static struct device_node * __init omap_get_timer_dt(struct of_device_id *match, struct device_node *np; for_each_matching_node(np, match) { - if (!of_device_is_available(np)) { - of_node_put(np); + if (!of_device_is_available(np)) continue; - } - if (property && !of_get_property(np, property, NULL)) { - of_node_put(np); + if (property && !of_get_property(np, property, NULL)) continue; - } of_add_property(np, &device_disabled); return np;