From patchwork Tue Jan 21 08:06:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 3515611 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 817209F2D6 for ; Tue, 21 Jan 2014 08:14:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8766E20155 for ; Tue, 21 Jan 2014 08:14:56 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4680F200EC for ; Tue, 21 Jan 2014 08:14:55 +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 1W5WTv-0007T7-Ao; Tue, 21 Jan 2014 08:14:47 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1W5WTs-0004zj-SN; Tue, 21 Jan 2014 08:14:44 +0000 Received: from mail-wi0-f180.google.com ([209.85.212.180]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1W5WTq-0004xs-0m for linux-arm-kernel@lists.infradead.org; Tue, 21 Jan 2014 08:14:42 +0000 Received: by mail-wi0-f180.google.com with SMTP id d13so4025661wiw.1 for ; Tue, 21 Jan 2014 00:14:20 -0800 (PST) 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; bh=I5nvxhyz3tsupznbBv5G7Ttu1CaYpdgYcV+w8Yn8rtg=; b=OD2IoV0ae+m0jKGgY3ba4O5YBtPkaBtWLSYuc8PijOmYg98t5h1NEJxJG44J+gHnh2 M/8GG0/db72iDzWAJljhgAiyDlLJJkRx0cZGW2YHL5pnrW4JNmXejhc2MSvbhDQvWpT2 CAK/Qu+N2MAP7e5FkajJUk1E1l7UuSl53txxWFt70F2OelIoumg1vPy2jP0lP4ds1d2k R9q3YPdg/LwH/Vi/iI3a0FsYAw7kt6QnHZ+Qw4hPCJZS77XA+QXikQDAF7sYXU4ILZuq G9HOUMPhu6BkATTE0vOJJ10JLJNu82f19J7JPlzqCqWiWVQQjfXbitDAXptJj2nGEHAj C4qg== X-Gm-Message-State: ALoCoQk+s7NJhl7BKzRHSXKSGNdK8KfEac4+G+eFAOqJT0gzA2jjUqtkqYYfeRptWxb9finpElfX X-Received: by 10.181.8.66 with SMTP id di2mr2872011wid.43.1390291592963; Tue, 21 Jan 2014 00:06:32 -0800 (PST) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id w1sm8564009wib.6.2014.01.21.00.06.31 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Jan 2014 00:06:31 -0800 (PST) From: Linus Walleij To: Mike Turquette Subject: [PATCH] clk: nomadik: fix multiplatform problem Date: Tue, 21 Jan 2014 09:06:21 +0100 Message-Id: <1390291581-5858-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 1.8.4.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140121_031442_164985_FB70F0B1 X-CRM114-Status: GOOD ( 12.20 ) X-Spam-Score: -2.6 (--) Cc: Andrew Lunn , Linus Walleij , linux-arm-kernel@lists.infradead.org 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-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 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The Nomadik debugfs screws up multiplatform boots if debugfs is enabled on the multiplatform image, since it's a simple initcall that is unconditionally executed and reads from certain memory locations. Fix this by checking that the driver has been properly initialized, so a base offset to the Nomadik SRC controller exists, before proceeding to register debugfs files. Reported-by: Andrew Lunn Signed-off-by: Linus Walleij Tested-by: Andrew Lunn --- drivers/clk/clk-nomadik.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/clk/clk-nomadik.c b/drivers/clk/clk-nomadik.c index 6a934a5296bd..05e04ce0f148 100644 --- a/drivers/clk/clk-nomadik.c +++ b/drivers/clk/clk-nomadik.c @@ -494,6 +494,9 @@ static const struct file_operations nomadik_src_clk_debugfs_ops = { static int __init nomadik_src_clk_init_debugfs(void) { + /* Vital for multiplatform */ + if (!src_base) + return -ENODEV; src_pcksr0_boot = readl(src_base + SRC_PCKSR0); src_pcksr1_boot = readl(src_base + SRC_PCKSR1); debugfs_create_file("nomadik-src-clk", S_IFREG | S_IRUGO,