From patchwork Mon Nov 4 14:22:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 178426 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp1549933ilf; Mon, 4 Nov 2019 06:23:21 -0800 (PST) X-Google-Smtp-Source: APXvYqzhu3gqmRMipwEPUeXIkUeLXqccNpfW1vzqOzFmnMi8NbZ+fIh7JLuhpWcnMA9wrAmfsgoE X-Received: by 2002:aa7:db82:: with SMTP id u2mr29281114edt.256.1572877401781; Mon, 04 Nov 2019 06:23:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572877401; cv=none; d=google.com; s=arc-20160816; b=J5ZLLChPmwTbxiOFxgku3+xGSCZ2/cBo9PKNiYwg7dq9krBWUMFeOzGVEsvP33kkSI ZZTzaKqYnxlA5C+RUgnU+Gh+zpfAwb1vkjA/7THycxXeSjgu28zoEMQx2PmbR2ibtgX1 QrhXAFLDT8HCjvWrfMtkF7K2WI5yOr7jwH3aOEu0+wnZnTM3VxPp5YBtmnVfUF67Kx4Q dumZ6EY9Gg9NChOm+kmrFl8UnOOEVaqfAfl6zV1hI2go5RSxmLbH9S8jOqTHU4m7ANzd 7LjscBy97+PrHspYsyEtbs9MzfUWPH8Omx093BUce5AOUyLTHu2cZjs8OHxVTtXYsY0D vDaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=o012SHvPj5zgU3QBeDKlShRnobqJxcJuQYC3/1lC2yI=; b=EMtj0qQmhrvI/pvSadYemHTXT4mcEapTOQ6rz63U/1QxcMSy/3q0i08qliE8D23wCS d4cOrYLA+2hv2ROgA53+ccOZvJnIDOQMPO2CDM6dlkr8fxYIDNTlJRKqZPRtzYw7osVU 7msrrH5hhBr8nv1NPowhdjWFYlBz4zj0yuBdcpKQ60ZR1ylyi71XjkhAJMzfYIlNx7oJ bTAw8GiO0zhEIfPXoiPWeRxmXFm3HrnzDH2gTy8+VlNxjttDq1mjRTx3MQLrpWkzdnPt A7tdlSKfEJO/41ocSAOqmiNeMo93owDLzoS3O37Y0hHk11GlAcwvWJsJnkqfSpTt5k7K 7Jsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="P6v8/SKz"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k24si4642696ejv.111.2019.11.04.06.23.21; Mon, 04 Nov 2019 06:23:21 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="P6v8/SKz"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728718AbfKDOXU (ORCPT + 26 others); Mon, 4 Nov 2019 09:23:20 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:37911 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728630AbfKDOXS (ORCPT ); Mon, 4 Nov 2019 09:23:18 -0500 Received: by mail-wm1-f68.google.com with SMTP id z19so12099910wmk.3 for ; Mon, 04 Nov 2019 06:23:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=o012SHvPj5zgU3QBeDKlShRnobqJxcJuQYC3/1lC2yI=; b=P6v8/SKz37UVfswKof2UASy8k/JJK8EJbfOp9D8iXlt7Orgu1ThjaodbG9fslrMQnO zVVgmQvVkolxffNUUqOeFea48ZDitteEuJhG3qqC3ivv0Bb/Nm7ueV+tCL2kh7xugyE+ Pz/84pvIkRFpVBikcM3KyEr0cBtdEUVxg+8fY2zharmNIJNt/6aPH3BW+bYaaBJeABj7 8xfSmSyNswgjhaytWeLRpc/CYXqkN03SrAUkPoXkrVeKpLoIgk08VNp1jqJI7RuyX9AS DhVi7LBxLRaK+iyyZ6we6XAANJBMKO0Gyu6gvpAOfp6UIDMYcwSyvFii9vNgL6BGeW5J DjIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=o012SHvPj5zgU3QBeDKlShRnobqJxcJuQYC3/1lC2yI=; b=TmP3NatUd2QY2j3kjCNgL95mJJQUAYKqBJDeZNFpydFlY2tBfNpJz4SDfelYfhwBCw gm3Cyd3Omk6o4/4Ypht6Vauj76UAgZEu9nXA9UroQtRX/NFB37a6ko/tO/ZqKephwky6 Lz4AoEwigOX71Ck+epscxm+gll1Qxni74SYbhVgpZQsVHyWskqh0XwbcHFLkvIAO1qZa gbND1NYTt+dz85Qzjjsqs5mawVX+SXTG3aJNiw3Sq3BV2bxuGFZ887aMVk0QsWUfcsKM k6sqBgIIygS2ceKFuq0Nw/Vs3iIFsoLaaA5OeyJlNg2BXV4AM80KcUxIgT6xvfrq8hNB UOpg== X-Gm-Message-State: APjAAAXtmAajWLdZ4gh7Db365uMx3kFfuVPm6dXmEywxyW/nCRR3Wl4X gm1t9oyemGqDqJAVH4LsHrddPA== X-Received: by 2002:a7b:cc86:: with SMTP id p6mr23222709wma.116.1572877395942; Mon, 04 Nov 2019 06:23:15 -0800 (PST) Received: from mai.imgcgcw.net ([2a01:e34:ed2f:f020:58da:b044:f184:d281]) by smtp.gmail.com with ESMTPSA id l18sm21692446wrn.48.2019.11.04.06.23.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Nov 2019 06:23:15 -0800 (PST) From: Daniel Lezcano To: tglx@linutronix.de Cc: linux-kernel@vger.kernel.org, Chuhong Yuan Subject: [PATCH 5/5] clocksource/drivers/asm9260: Add a check for of_clk_get Date: Mon, 4 Nov 2019 15:22:57 +0100 Message-Id: <20191104142257.30029-5-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191104142257.30029-1-daniel.lezcano@linaro.org> References: <6fd4d800-b1f8-d757-458e-23742d20884c@linaro.org> <20191104142257.30029-1-daniel.lezcano@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chuhong Yuan asm9260_timer_init misses a check for of_clk_get. Add a check for it and print errors like other clocksource drivers. Signed-off-by: Chuhong Yuan Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20191016124330.22211-1-hslester96@gmail.com --- drivers/clocksource/asm9260_timer.c | 4 ++++ 1 file changed, 4 insertions(+) -- 2.17.1 diff --git a/drivers/clocksource/asm9260_timer.c b/drivers/clocksource/asm9260_timer.c index 9f09a59161e7..5b39d3701fa3 100644 --- a/drivers/clocksource/asm9260_timer.c +++ b/drivers/clocksource/asm9260_timer.c @@ -194,6 +194,10 @@ static int __init asm9260_timer_init(struct device_node *np) } clk = of_clk_get(np, 0); + if (IS_ERR(clk)) { + pr_err("Failed to get clk!\n"); + return PTR_ERR(clk); + } ret = clk_prepare_enable(clk); if (ret) {