Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp7438664ybp; Wed, 16 Oct 2019 08:39:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqz/Zg9LPRaozvMjfGWk0HtETO9LdBWNXGa7zJ5Ncbv+y9Fnfveh6P661V9gRV5pfIU9Lnvc X-Received: by 2002:a17:906:2410:: with SMTP id z16mr40873435eja.120.1571240374845; Wed, 16 Oct 2019 08:39:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571240374; cv=none; d=google.com; s=arc-20160816; b=EOuFlG6ojlKkKoQ695IO8kY2ruRhFLdEl4fWBv4+jsEP17i23rt8qbSWdrljBVRUKK tX3G0+MH8C4h8VdSfdKZlcigyOZE4f+YUXiLckiIFXHkT61RFGLpWXd4YzGwnBTZMn71 rLsb6zX2xXkcQm1uLotFkEeDBWqFH7bElGp6zLFArzgPb1KA98Cq78x/4JUNSKwAkz+v oR1TSHeUSLlEKEJzJmil1cgvLLZaplqICiPoQRExRUBWUjvoDUrX8aNN+We+KkLgBKvb WIimwuNXJV5ADmLvfbSB8pVaSzMNt7ar/LY72NHdcm71fplne4PtqFh7i68LTijNvYdH igxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:content-transfer-encoding:mime-version :message-id:date:subject:cc:from:dkim-signature; bh=kFYPT3OrsbiUD60Nb8NDIx2f6C6Q/2ZZ3HTvfG2KWDI=; b=t6CxJ6QuDE44rp924Ij3QI9pcEMcVyYagfBpekw5N1SMyFB9I7XSWr1f3inOSXCgDb eargSzWwMqIDzPXB+F7Si6R+Slo+kH8M6SFA3KPOCXsUPLYxZH0g3a6nTMDD2kCjfyLs AX2aPtRVqgpK01lLCrKBZ/QBa3v3TFN8xkWUtkwFgqqnOd+hYxUE+/asfMrNtF5G7prg MlOCDF3+IEKZumLPmdKcJ/+sJxuGMQ4z/nvmAZLIBL/+K6D6pwmBVHGD49ZoGqIW7Xq4 6bB9XrfvhWcKd93EfgtsR7bLeHrjUgD2Dw+hDPwKMqN4M2iDaozQXTQfcK+adq39DxXV cPjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=TGF2yffb; 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=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q10si18505715eda.293.2019.10.16.08.39.12; Wed, 16 Oct 2019 08:39:34 -0700 (PDT) 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=fail header.i=@gmail.com header.s=20161025 header.b=TGF2yffb; 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=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393162AbfJPMno (ORCPT + 99 others); Wed, 16 Oct 2019 08:43:44 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:44978 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726985AbfJPMnn (ORCPT ); Wed, 16 Oct 2019 08:43:43 -0400 Received: by mail-pl1-f193.google.com with SMTP id q15so11214686pll.11 for ; Wed, 16 Oct 2019 05:43:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=kFYPT3OrsbiUD60Nb8NDIx2f6C6Q/2ZZ3HTvfG2KWDI=; b=TGF2yffbWIfYdq0R5MXC7aLdf2wihHo/XfTvhYAQ5bopyjIE6lMn2U21/SkQZR3zes v5JLJjnsHYDGNAmE2ci+pQy33q2Tk3WNhlgVMeLV57PmFmECvuM6th9Cbk+ZPachApgl H7zyK2DvXEcpCMkubmEnKrOVguuUldDwiCyzxpc9sCSjZDUg3SgHOeemOS1ZvhqrNlWe c3CgychUcuzfEaAJQrIVU+acJX4C+4QtUfKGwJOpfLAAf6RtbepKKCeilDh3k6bFwPnT 5hOpvQTNbW9NwEt0DLVDnGHd5kUO79x12hTHgp2C2/ZQNc73FFvnMOi/F+NUemPxj1eF //rg== 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:mime-version :content-transfer-encoding; bh=kFYPT3OrsbiUD60Nb8NDIx2f6C6Q/2ZZ3HTvfG2KWDI=; b=Vw6ZxGXrp1cuItMhjue1vRU//6/gh0C3PSgaMOFG7N5mCwfRfI9ryjR+bm8Cc5isc0 gO3KkDzlnIrCdpNMXOg7n+IdaZVxtdXVEjxsrRyCylmHg0AeHCoOhO/3vzNdO146AL+Q w9dxSMF9s7Krk7THboqKI7TFDZlmdOoakAbup3K2+0fFWfhVOhMMwWAuOD0h1fpST4Cl Ch1qq6KRC5ZzzgKTnlJBbhwp7gXtDuipGU8Zz/8vw+b5O0CI4J4AgR+7IprFbvcSq3w/ r8iJS+wk9Ygf2DsSyz/SvNO2K+JZAKLxxXFrj0UX8TjL7UFEG+qCLm1mLcYtkWFEMR/u ZZmw== X-Gm-Message-State: APjAAAUPLUS8ktl/n7TLDR5Li4J6fYi6v1Y8OyYp83XwGJSXow5DJk/d onAB0b8csGvn1AkChzmZMyw= X-Received: by 2002:a17:902:728f:: with SMTP id d15mr41460060pll.211.1571229822775; Wed, 16 Oct 2019 05:43:42 -0700 (PDT) Received: from suzukaze.ipads-lab.se.sjtu.edu.cn ([89.31.126.54]) by smtp.gmail.com with ESMTPSA id i37sm2604894pje.23.2019.10.16.05.43.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Oct 2019 05:43:41 -0700 (PDT) From: Chuhong Yuan Cc: Daniel Lezcano , Thomas Gleixner , linux-kernel@vger.kernel.org, Chuhong Yuan Subject: [PATCH] clocksource: asm9260: Add a check for of_clk_get Date: Wed, 16 Oct 2019 20:43:30 +0800 Message-Id: <20191016124330.22211-1-hslester96@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/clocksource/asm9260_timer.c | 4 ++++ 1 file changed, 4 insertions(+) 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) { -- 2.20.1