Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752315AbdGXWxn (ORCPT ); Mon, 24 Jul 2017 18:53:43 -0400 Received: from fllnx209.ext.ti.com ([198.47.19.16]:47858 "EHLO fllnx209.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932926AbdGXWxD (ORCPT ); Mon, 24 Jul 2017 18:53:03 -0400 From: Franklin S Cooper Jr To: , , , , , , , CC: Franklin S Cooper Jr Subject: [PATCH v2 1/3] can: m_can: Make hclk optional Date: Mon, 24 Jul 2017 17:51:40 -0500 Message-ID: <20170724225142.19975-2-fcooper@ti.com> X-Mailer: git-send-email 2.10.0 In-Reply-To: <20170724225142.19975-1-fcooper@ti.com> References: <20170724225142.19975-1-fcooper@ti.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1224 Lines: 36 Hclk is the MCAN's interface clock. However, for OMAP based devices such as DRA7 SoC family the interface clock is handled by hwmod. Therefore, this interface clock is managed by hwmod driver via pm_runtime_get and pm_runtime_put calls. Therefore, this interface clock isn't defined in DT and thus the driver shouldn't fail if this clock isn't found. Signed-off-by: Franklin S Cooper Jr --- Version 2 changes: Used NULL instead of 0 for unused hclk handle drivers/net/can/m_can/m_can.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c index f4947a7..ea48e59 100644 --- a/drivers/net/can/m_can/m_can.c +++ b/drivers/net/can/m_can/m_can.c @@ -1568,8 +1568,13 @@ static int m_can_plat_probe(struct platform_device *pdev) hclk = devm_clk_get(&pdev->dev, "hclk"); cclk = devm_clk_get(&pdev->dev, "cclk"); - if (IS_ERR(hclk) || IS_ERR(cclk)) { - dev_err(&pdev->dev, "no clock found\n"); + if (IS_ERR(hclk)) { + dev_warn(&pdev->dev, "hclk could not be found\n"); + hclk = NULL; + } + + if (IS_ERR(cclk)) { + dev_err(&pdev->dev, "cclk could not be found\n"); ret = -ENODEV; goto failed_ret; } -- 2.10.0