From patchwork Tue Jul 25 18:32:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergej Sawazki X-Patchwork-Id: 9862715 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 CD690600F5 for ; Tue, 25 Jul 2017 18:33:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C8A852871E for ; Tue, 25 Jul 2017 18:33:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BCEC82870D; Tue, 25 Jul 2017 18:33:09 +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.9 required=2.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI 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 37FF02870D for ; Tue, 25 Jul 2017 18:33:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750783AbdGYSdI (ORCPT ); Tue, 25 Jul 2017 14:33:08 -0400 Received: from mout.gmx.net ([212.227.17.20]:64782 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750768AbdGYSdH (ORCPT ); Tue, 25 Jul 2017 14:33:07 -0400 Received: from duke.fritz.box ([91.35.168.110]) by mail.gmx.com (mrgmx102 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MVJze-1d5vlr3rW2-00Yh3C; Tue, 25 Jul 2017 20:33:02 +0200 From: Sergej Sawazki To: sboyd@codeaurora.org, mturquette@baylibre.com Cc: linux-clk@vger.kernel.org, Sergej Sawazki , Sebastian Hesselbarth , Rabeeh Khoury Subject: [PATCH v2] clk: si5351: Do not enable parent clocks on probe Date: Tue, 25 Jul 2017 20:32:11 +0200 Message-Id: <1501007531-5521-1-git-send-email-ce3a@gmx.de> X-Mailer: git-send-email 2.7.4 X-Provags-ID: V03:K0:hbccaQYckkKBcKpADxjfDbZdDC5dK2/9DYjCgm9TvmR9/Wew/bq ZwCoB/WEnYchHBVUvlpTBgj1psL+z3MZhMlqLO1flqrRJizotvk8OvtHif0yqaACDKZ85sH aSRVzwpRaTDfL7RaCm8Klqf9mvccT3Ve/MQ6G5kTbDg3oKguY+5l5sKHY074V5KIZHXWrJh KFvqJdvQx2nuD8jSucI7g== X-UI-Out-Filterresults: notjunk:1; V01:K0:uoU0rjJdAs8=:eUccLL4SFSCpnwWGqbsM4k +rtBmE6c/fDYyj/Layw3iZiaUj8Wx00fAXh2/8P4x5u2c/im5TJPMdpxtZLXs+lon0nHtxDCU q+hSGhgylzFQ5AIM3DWMnc3JLm3AjbQ1zPkGEql+nL54sWJCWKkZyNgMzhzolh6wSwymcPoii HtbVkxPte3fQU43Tn+38obYUE7xDF/sH9M2vM7AiyJUxFTR0mNq4iAjytMclr/qHs0wvaJPhm WxFhmguIUIUYMPofjijeZMKjm6BSHEUnnH3wQyUY2oI2GZzxcUu1cCHOA2UDL3Fp3+aiHFFKQ SlRRNhUmczqPqatR0+C4c7RBla5Q+632MZ93WEduEibtQDUBq3tuGUUdJUCRuHQ1GTkDaVUDF lj3ltx37OLtbemtzXEDJTmguwyA5L1O8wwA5w30nQ+MWSXLGZ4Rt3ifbPISZjbfqnEZ9ZJlRr XBj+Jlru2Yhv63njV39GlvwvrIPAkpOH2tb3DUa1qp8JqoByDQmywmUD1h+ZzwkxFauhgZYLO YmEBtsoTegj03bAeRZLY75/1jNoW3cdGnPKKU54elVoowFzMZOxZHEEfJA9V7Ykmwsh/FIral xOvbAfRWmUCW1VLlrI7DpH12NtW0rjNFqlUqyCbW6VosHvvX8rggWfxbnWG8aLRHJDT6yZ5K6 FsvckZyUPEveDdm3ZewURWTGk56ig3pmzAJfXTfVCG2WJQlXz86PDa6/1ktLJWtDmFjPIsRJQ WsOiKtu0Ag1adBY9Q9aM275EplJCQ1X3wAo/5aAiDKDGO5U/BzWiijMTpBC9+sHtJkFAkPb+g SdsMel30ZUHVN3r+Hf3pF+P3iQ5Qw== 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 The si5351 driver should not prepare or enable other clocks in the tree on probe. Let the clients decide when to prepare or enable the clocks. Cc: Sebastian Hesselbarth Cc: Rabeeh Khoury Signed-off-by: Sergej Sawazki --- Changes in v2: * Remove also the prepare drivers/clk/clk-si5351.c | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/drivers/clk/clk-si5351.c b/drivers/clk/clk-si5351.c index 2492442..255d0fe 100644 --- a/drivers/clk/clk-si5351.c +++ b/drivers/clk/clk-si5351.c @@ -1439,11 +1439,6 @@ static int si5351_i2c_probe(struct i2c_client *client, } } - if (!IS_ERR(drvdata->pxtal)) - clk_prepare_enable(drvdata->pxtal); - if (!IS_ERR(drvdata->pclkin)) - clk_prepare_enable(drvdata->pclkin); - /* register xtal input clock gate */ memset(&init, 0, sizeof(init)); init.name = si5351_input_names[0]; @@ -1458,7 +1453,7 @@ static int si5351_i2c_probe(struct i2c_client *client, ret = devm_clk_hw_register(&client->dev, &drvdata->xtal); if (ret) { dev_err(&client->dev, "unable to register %s\n", init.name); - goto err_clk; + return ret; } /* register clkin input clock gate */ @@ -1476,7 +1471,7 @@ static int si5351_i2c_probe(struct i2c_client *client, if (ret) { dev_err(&client->dev, "unable to register %s\n", init.name); - goto err_clk; + return ret; } } @@ -1498,7 +1493,7 @@ static int si5351_i2c_probe(struct i2c_client *client, ret = devm_clk_hw_register(&client->dev, &drvdata->pll[0].hw); if (ret) { dev_err(&client->dev, "unable to register %s\n", init.name); - goto err_clk; + return ret; } /* register PLLB or VXCO (Si5351B) */ @@ -1522,7 +1517,7 @@ static int si5351_i2c_probe(struct i2c_client *client, ret = devm_clk_hw_register(&client->dev, &drvdata->pll[1].hw); if (ret) { dev_err(&client->dev, "unable to register %s\n", init.name); - goto err_clk; + return ret; } /* register clk multisync and clk out divider */ @@ -1541,7 +1536,7 @@ static int si5351_i2c_probe(struct i2c_client *client, if (WARN_ON(!drvdata->msynth || !drvdata->clkout)) { ret = -ENOMEM; - goto err_clk; + return ret; } for (n = 0; n < num_clocks; n++) { @@ -1561,7 +1556,7 @@ static int si5351_i2c_probe(struct i2c_client *client, if (ret) { dev_err(&client->dev, "unable to register %s\n", init.name); - goto err_clk; + return ret; } } @@ -1589,7 +1584,7 @@ static int si5351_i2c_probe(struct i2c_client *client, if (ret) { dev_err(&client->dev, "unable to register %s\n", init.name); - goto err_clk; + return ret; } /* set initial clkout rate */ @@ -1608,17 +1603,10 @@ static int si5351_i2c_probe(struct i2c_client *client, drvdata); if (ret) { dev_err(&client->dev, "unable to add clk provider\n"); - goto err_clk; + return ret; } return 0; - -err_clk: - if (!IS_ERR(drvdata->pxtal)) - clk_disable_unprepare(drvdata->pxtal); - if (!IS_ERR(drvdata->pclkin)) - clk_disable_unprepare(drvdata->pclkin); - return ret; } static const struct i2c_device_id si5351_i2c_ids[] = {