From patchwork Mon Jul 24 22:51:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Franklin S Cooper Jr X-Patchwork-Id: 793125 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=ti.com header.i=@ti.com header.b="tS2QICCC"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3xGc9b6qkLz9s2G for ; Tue, 25 Jul 2017 08:53:39 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932981AbdGXWxh (ORCPT ); Mon, 24 Jul 2017 18:53:37 -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 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by fllnx209.ext.ti.com (8.15.1/8.15.1) with ESMTP id v6OMq00F004105; Mon, 24 Jul 2017 17:52:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1500936720; bh=PE2D/QLUdH3G8S/fr2ZlcQ8DmDuy6XC8FjZx9VD5ryE=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=tS2QICCCVgVBRTgS+Q8GU1LnSq/wvwujRGBLwLBtU3O6W18QWyY4luY+zxXIVJO3T v/O1LrzRDpvJCdVBGCXTDskvOJ1ihMmPU37+K7eg5utqSx5V3krneFcHcx5wxcErQh UWyXi2CONbhe0Kg9Uld9ZrBbVdOq1NAloQIWgUUA= Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id v6OMptVJ008664; Mon, 24 Jul 2017 17:51:55 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.3.294.0; Mon, 24 Jul 2017 17:51:54 -0500 Received: from dbdmail01.india.ti.com (dbdmail01.india.ti.com [172.24.162.206]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id v6OMprKE018218; Mon, 24 Jul 2017 17:51:54 -0500 Received: from udb0273011.dhcp.ti.com (udb0273011.dhcp.ti.com [128.247.59.33]) by dbdmail01.india.ti.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id v6OMpkxx002491; Tue, 25 Jul 2017 04:21:50 +0530 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 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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; }