Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964985AbdGTJms (ORCPT ); Thu, 20 Jul 2017 05:42:48 -0400 Received: from mail-lf0-f48.google.com ([209.85.215.48]:35414 "EHLO mail-lf0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935849AbdGTJmg (ORCPT ); Thu, 20 Jul 2017 05:42:36 -0400 Subject: Re: [PATCH 1/3] can: m_can: Make hclk optional To: Franklin S Cooper Jr , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, netdev@vger.kernel.org, linux-can@vger.kernel.org, wg@grandegger.com, mkl@pengutronix.de, robh+dt@kernel.org, quentin.schulz@free-electrons.com References: <20170719230926.10872-1-fcooper@ti.com> <20170719230926.10872-2-fcooper@ti.com> From: Sergei Shtylyov Message-ID: <11cb765b-d69a-d7d5-b1e4-b55200764e63@cogentembedded.com> Date: Thu, 20 Jul 2017 12:42:33 +0300 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20170719230926.10872-2-fcooper@ti.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1161 Lines: 34 Hello! On 7/20/2017 2:09 AM, Franklin S Cooper Jr wrote: > 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 > --- > 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..7fe9145 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, "can't find hclk\n"); > + hclk = 0; s/0/NULL/. [...] MBR, Sergei