From patchwork Fri Aug 28 09:16:13 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 7090591 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id BEFCA9F46B for ; Fri, 28 Aug 2015 09:12:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DAF4E20839 for ; Fri, 28 Aug 2015 09:12:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E3FDC20835 for ; Fri, 28 Aug 2015 09:12:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751900AbbH1JMH (ORCPT ); Fri, 28 Aug 2015 05:12:07 -0400 Received: from mail-pa0-f42.google.com ([209.85.220.42]:36713 "EHLO mail-pa0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751573AbbH1JMF (ORCPT ); Fri, 28 Aug 2015 05:12:05 -0400 Received: by padhm10 with SMTP id hm10so973572pad.3; Fri, 28 Aug 2015 02:12:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:date:message-id:in-reply-to:references:subject; bh=JdDfoStX7u33tK/Bvk1mnmMh7XkAN4MZnO6i7/st5UY=; b=N+z6h9RA5XUhnD+9piI7GpYa5b0IWvp/o6N8TnOeN7qTKx5aHvMlFPaxRPNLHIwfIQ zxQnd6o9EHVKKOAupmDBs2Je3FiOzPoLOHJCNQS60oPl+L4j+QDPgHsuMr7qg2mNIK+1 cuYC0gtJ3mFxpyRUWtXoVT34cD+GAYruSpqJQojahEewhyvLwd5FPASVbOH9F2gpPJdZ MskyJFhOiXMjXiFdDT8cVsP0PINwQxnEYLq9LgDkERHvNJEYXEizDaISL6H6jOtvhr/0 pUDj4WR4/DjzDqVoI9glUEy5ZrrwfT3wBBQq1LLmQwlXTVVUpU7+dxue7B4fjkcX0OiH t8SA== X-Received: by 10.66.233.1 with SMTP id ts1mr13311052pac.128.1440753125515; Fri, 28 Aug 2015 02:12:05 -0700 (PDT) Received: from [127.0.0.1] (s214090.ppp.asahi-net.or.jp. [220.157.214.90]) by smtp.gmail.com with ESMTPSA id l4sm5027327pde.31.2015.08.28.02.12.01 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Aug 2015 02:12:03 -0700 (PDT) From: Magnus Damm To: linux-clk@vger.kernel.org Cc: kuninori.morimoto.gx@renesas.com, gaku.inami.xw@bp.renesas.com, mturquette@baylibre.com, linux-sh@vger.kernel.org, sboyd@codeaurora.org, horms@verge.net.au, geert@linux-m68k.org, laurent.pinchart@ideasonboard.com, Magnus Damm Date: Fri, 28 Aug 2015 18:16:13 +0900 Message-Id: <20150828091613.21731.8527.sendpatchset@little-apple> In-Reply-To: <20150828091550.21731.85227.sendpatchset@little-apple> References: <20150828091550.21731.85227.sendpatchset@little-apple> Subject: [PATCH v3 02/04] clk: shmobile: Make MSTP clock-output-names optional Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-8.2 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham 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 From: Magnus Damm This patch updates the MSTP driver to make the "clock-output-names" DT property optional instead of mandatory. In case the DT property is omitted then the function clk_register_clkdev() is skipped. The default for new SoCs is to not use "clock-output-names". This version of the patch is kind of early, so please handle with care. So far the patch has only been tested with a single MSTP clock. =) Not-Yet-Signed-off-by: Magnus Damm --- drivers/clk/shmobile/clk-mstp.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- 0001/drivers/clk/shmobile/clk-mstp.c +++ work/drivers/clk/shmobile/clk-mstp.c 2015-08-28 15:03:28.002366518 +0900 @@ -198,15 +198,12 @@ static void __init cpg_mstp_clocks_init( for (i = 0; i < MSTP_MAX_CLOCKS; ++i) { const char *parent_name; - const char *name; + const char *name = NULL; u32 clkidx; int ret; - /* Skip clocks with no name. */ ret = of_property_read_string_index(np, "clock-output-names", i, &name); - if (ret < 0 || strlen(name) == 0) - continue; parent_name = of_clk_get_parent_name(np, i); ret = of_property_read_u32_index(np, idxname, i, &clkidx); @@ -214,12 +211,13 @@ static void __init cpg_mstp_clocks_init( break; if (clkidx >= MSTP_MAX_CLOCKS) { - pr_err("%s: invalid clock %s %s index %u)\n", - __func__, np->name, name, clkidx); + pr_err("%s: invalid clock %s index %u)\n", + __func__, np->name, clkidx); continue; } - clks[clkidx] = cpg_mstp_clock_register(name, parent_name, + clks[clkidx] = cpg_mstp_clock_register(name ? name : np->name, + parent_name, clkidx, group); if (!IS_ERR(clks[clkidx])) { group->data.clk_num = max(group->data.clk_num, @@ -232,7 +230,8 @@ static void __init cpg_mstp_clocks_init( * FIXME: Remove this when all devices that require a * clock will be instantiated from DT. */ - clk_register_clkdev(clks[clkidx], name, NULL); + if (name) /* only if clock-output-names is provided */ + clk_register_clkdev(clks[clkidx], name, NULL); } else { pr_err("%s: failed to register %s %s clock (%ld)\n", __func__, np->name, name, PTR_ERR(clks[clkidx]));