From patchwork Tue Jul 19 09:21:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 9236563 X-Patchwork-Delegate: sboyd@codeaurora.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 09E9F6075D for ; Tue, 19 Jul 2016 09:21:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EE6DA20072 for ; Tue, 19 Jul 2016 09:21:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E2FC626247; Tue, 19 Jul 2016 09:21:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 76BAE20072 for ; Tue, 19 Jul 2016 09:21:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753311AbcGSJUX (ORCPT ); Tue, 19 Jul 2016 05:20:23 -0400 Received: from conuserg-09.nifty.com ([210.131.2.76]:51262 "EHLO conuserg-09.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753104AbcGSJUR (ORCPT ); Tue, 19 Jul 2016 05:20:17 -0400 Received: from beagle.diag.org (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-09.nifty.com with ESMTP id u6J9JqMi000550; Tue, 19 Jul 2016 18:19:56 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com u6J9JqMi000550 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1468919996; bh=M74esWkA+Bh1yZEWxgr1CQ62rh1YtiR66k3Xac6gBOk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=w6riNejGfC/k3RQmpCQAaP3qxeLH/vAYO4jotfRE2FJWwVuukzPc2DtLag7W9QTVT BsXItX2shT14RTMPqF8sFdxBZsf7Faz8Dhu8x+xPnrciX7ceYf9slv42j6chDhYEnH ZXppARiUBz99FCyX47bs8ksbTjlbwyjQDBpcSs9PpviuoVD4isnPrkxzIiVSd4jnYq r4x5gaAXkTY/onKMOfeL/KALB6FQE38WVIxAE3+cANSk2Lp6AlkNNiKMCZDrdCu4gD TLmdy/5cl5nCPtZkQT3cyJ5EgsjLfcbY1H8JFUvMwpFAECg36L2U235CL2D/caLlKL fQvF6+lYJQ/LQ== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-clk@vger.kernel.org Cc: Masahiro Yamada , Stephen Boyd , Michael Turquette , linux-kernel@vger.kernel.org Subject: [PATCH 5/5] clk: return -EINVAL if clock provider has no .get callback Date: Tue, 19 Jul 2016 18:21:38 +0900 Message-Id: <1468920098-8553-6-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1468920098-8553-1-git-send-email-yamada.masahiro@socionext.com> References: <1468920098-8553-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Currently, __of_clk_get_hw_from_provider() returns -EPROBE_DEFER if neither .get_hw nor .get is registered for the given provider. This means of_clk_add(_hw)_provider() has been already called for the node in a wrong way; it is not deferred probing at all. EINVAL is a better fit for the case. Signed-off-by: Masahiro Yamada --- drivers/clk/clk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index 2207098..3004388 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -3136,7 +3136,7 @@ __of_clk_get_hw_from_provider(struct of_clk_provider *provider, struct of_phandle_args *clkspec) { struct clk *clk; - struct clk_hw *hw = ERR_PTR(-EPROBE_DEFER); + struct clk_hw *hw = ERR_PTR(-EINVAL); if (provider->get_hw) { hw = provider->get_hw(clkspec, provider->data);