From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752468AbbL1KXM (ORCPT ); Mon, 28 Dec 2015 05:23:12 -0500 Received: from conuserg009.nifty.com ([202.248.44.35]:46761 "EHLO conuserg009-v.nifty.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752130AbbL1KW6 (ORCPT ); Mon, 28 Dec 2015 05:22:58 -0500 X-Nifty-SrcIP: [153.142.97.90] From: Masahiro Yamada To: linux-clk@vger.kernel.org Cc: Masahiro Yamada , Stephen Boyd , Michael Turquette , linux-kernel@vger.kernel.org Subject: [RESEND PATCH v2 10/16] clk: move checking .git_parent to __clk_core_init() Date: Mon, 28 Dec 2015 19:23:04 +0900 Message-Id: <1451298191-30815-11-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1451298191-30815-1-git-send-email-yamada.masahiro@socionext.com> References: <1451298191-30815-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The .git_parent is mandatory for multi-parent clocks. Move the check to __clk_core_init(), like other callback checkings. Signed-off-by: Masahiro Yamada --- Changes in v2: None drivers/clk/clk.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index e6e10f5..4ad0a36 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -1677,13 +1677,6 @@ static struct clk_core *__clk_init_parent(struct clk_core *core) goto out; } - if (!core->ops->get_parent) { - WARN(!core->ops->get_parent, - "%s: multi-parent clocks must implement .get_parent\n", - __func__); - goto out; - } - /* * Do our best to cache parent clocks in core->parents. This prevents * unnecessary and expensive lookups. We don't set core->parent here; @@ -2315,6 +2308,11 @@ static int __clk_core_init(struct clk_core *core) goto out; } + if (core->num_parents > 1 && !core->ops->get_parent) { + pr_err("%s: %s must implement .get_parent as it has multi parents\n", + __func__, core->name); + } + if (core->ops->set_rate_and_parent && !(core->ops->set_parent && core->ops->set_rate)) { pr_err("%s: %s must implement .set_parent & .set_rate\n", -- 1.9.1