From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934478AbdC3P10 (ORCPT ); Thu, 30 Mar 2017 11:27:26 -0400 Received: from mail.free-electrons.com ([62.4.15.54]:43339 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933769AbdC3PX1 (ORCPT ); Thu, 30 Mar 2017 11:23:27 -0400 From: Gregory CLEMENT To: Ulf Hansson , Adrian Hunter , linux-mmc@vger.kernel.org Cc: Jason Cooper , Andrew Lunn , Sebastian Hesselbarth , Gregory CLEMENT , Thomas Petazzoni , linux-arm-kernel@lists.infradead.org, Mike Turquette , Stephen Boyd , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Rob Herring , devicetree@vger.kernel.org, Ziji Hu , Jimmy Xu , Jisheng Zhang , Nadav Haklai , Ryan Gao , Doug Jones , Victor Gu , "Wei(SOCP) Liu" , Wilson Ding , Yehuda Yitschak , Marcin Wojtas , Hanna Hawa , Kostya Porotchkin Subject: [PATCH v7 02/13] clk: apn806: Turn the eMMC clock as optional for dts backwards compatible Date: Thu, 30 Mar 2017 17:22:54 +0200 Message-Id: X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org First version of the binding didn't have the eMMC clock. This patch allows to not registering the eMMC clock if it is not present in the device tree. Then the device tree can be backwards compatible. Suggested-by: Stephen Boyd Signed-off-by: Gregory CLEMENT --- drivers/clk/mvebu/ap806-system-controller.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/drivers/clk/mvebu/ap806-system-controller.c b/drivers/clk/mvebu/ap806-system-controller.c index 901d89c4ab4a..103fe18a3c29 100644 --- a/drivers/clk/mvebu/ap806-system-controller.c +++ b/drivers/clk/mvebu/ap806-system-controller.c @@ -136,13 +136,19 @@ static int ap806_syscon_clk_probe(struct platform_device *pdev) } /* eMMC Clock is fixed clock divided by 3 */ - of_property_read_string_index(np, "clock-output-names", - 4, &name); - ap806_clks[4] = clk_register_fixed_factor(NULL, name, fixedclk_name, - 0, 1, 3); - if (IS_ERR(ap806_clks[4])) { - ret = PTR_ERR(ap806_clks[4]); - goto fail4; + if (of_property_read_string_index(np, "clock-output-names", + 4, &name)) { + ap806_clk_data.clk_num--; + dev_warn(&pdev->dev, + "eMMC clock mising: update the device tree!\n"); + } else { + ap806_clks[4] = clk_register_fixed_factor(NULL, name, + fixedclk_name, + 0, 1, 3); + if (IS_ERR(ap806_clks[4])) { + ret = PTR_ERR(ap806_clks[4]); + goto fail4; + } } of_clk_add_provider(np, of_clk_src_onecell_get, &ap806_clk_data); -- git-series 0.9.1 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gregory CLEMENT Subject: [PATCH v7 02/13] clk: apn806: Turn the eMMC clock as optional for dts backwards compatible Date: Thu, 30 Mar 2017 17:22:54 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: In-Reply-To: References: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org To: Ulf Hansson , Adrian Hunter , linux-mmc@vger.kernel.org Cc: Jimmy Xu , Andrew Lunn , Mike Turquette , Nadav Haklai , Ziji Hu , Victor Gu , Doug Jones , linux-clk@vger.kernel.org, Jisheng Zhang , Yehuda Yitschak , Marcin Wojtas , Kostya Porotchkin , Hanna Hawa , Sebastian Hesselbarth , devicetree@vger.kernel.org, Jason Cooper , Rob Herring , Ryan Gao , Gregory CLEMENT , "Wei(SOCP) Liu" , linux-arm-kernel@lists.infradead.org, Thomas Petazzoni , Stephen Boyd , linux-kernel@vger.kernel.org, Wilson List-Id: devicetree@vger.kernel.org First version of the binding didn't have the eMMC clock. This patch allows to not registering the eMMC clock if it is not present in the device tree. Then the device tree can be backwards compatible. Suggested-by: Stephen Boyd Signed-off-by: Gregory CLEMENT --- drivers/clk/mvebu/ap806-system-controller.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/drivers/clk/mvebu/ap806-system-controller.c b/drivers/clk/mvebu/ap806-system-controller.c index 901d89c4ab4a..103fe18a3c29 100644 --- a/drivers/clk/mvebu/ap806-system-controller.c +++ b/drivers/clk/mvebu/ap806-system-controller.c @@ -136,13 +136,19 @@ static int ap806_syscon_clk_probe(struct platform_device *pdev) } /* eMMC Clock is fixed clock divided by 3 */ - of_property_read_string_index(np, "clock-output-names", - 4, &name); - ap806_clks[4] = clk_register_fixed_factor(NULL, name, fixedclk_name, - 0, 1, 3); - if (IS_ERR(ap806_clks[4])) { - ret = PTR_ERR(ap806_clks[4]); - goto fail4; + if (of_property_read_string_index(np, "clock-output-names", + 4, &name)) { + ap806_clk_data.clk_num--; + dev_warn(&pdev->dev, + "eMMC clock mising: update the device tree!\n"); + } else { + ap806_clks[4] = clk_register_fixed_factor(NULL, name, + fixedclk_name, + 0, 1, 3); + if (IS_ERR(ap806_clks[4])) { + ret = PTR_ERR(ap806_clks[4]); + goto fail4; + } } of_clk_add_provider(np, of_clk_src_onecell_get, &ap806_clk_data); -- git-series 0.9.1 From mboxrd@z Thu Jan 1 00:00:00 1970 From: gregory.clement@free-electrons.com (Gregory CLEMENT) Date: Thu, 30 Mar 2017 17:22:54 +0200 Subject: [PATCH v7 02/13] clk: apn806: Turn the eMMC clock as optional for dts backwards compatible In-Reply-To: References: Message-ID: To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org First version of the binding didn't have the eMMC clock. This patch allows to not registering the eMMC clock if it is not present in the device tree. Then the device tree can be backwards compatible. Suggested-by: Stephen Boyd Signed-off-by: Gregory CLEMENT --- drivers/clk/mvebu/ap806-system-controller.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/drivers/clk/mvebu/ap806-system-controller.c b/drivers/clk/mvebu/ap806-system-controller.c index 901d89c4ab4a..103fe18a3c29 100644 --- a/drivers/clk/mvebu/ap806-system-controller.c +++ b/drivers/clk/mvebu/ap806-system-controller.c @@ -136,13 +136,19 @@ static int ap806_syscon_clk_probe(struct platform_device *pdev) } /* eMMC Clock is fixed clock divided by 3 */ - of_property_read_string_index(np, "clock-output-names", - 4, &name); - ap806_clks[4] = clk_register_fixed_factor(NULL, name, fixedclk_name, - 0, 1, 3); - if (IS_ERR(ap806_clks[4])) { - ret = PTR_ERR(ap806_clks[4]); - goto fail4; + if (of_property_read_string_index(np, "clock-output-names", + 4, &name)) { + ap806_clk_data.clk_num--; + dev_warn(&pdev->dev, + "eMMC clock mising: update the device tree!\n"); + } else { + ap806_clks[4] = clk_register_fixed_factor(NULL, name, + fixedclk_name, + 0, 1, 3); + if (IS_ERR(ap806_clks[4])) { + ret = PTR_ERR(ap806_clks[4]); + goto fail4; + } } of_clk_add_provider(np, of_clk_src_onecell_get, &ap806_clk_data); -- git-series 0.9.1