From patchwork Tue Jun 27 09:27:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 106411 Delivered-To: patch@linaro.org Received: by 10.140.101.48 with SMTP id t45csp996434qge; Tue, 27 Jun 2017 02:29:12 -0700 (PDT) X-Received: by 10.98.43.7 with SMTP id r7mr4264455pfr.202.1498555752308; Tue, 27 Jun 2017 02:29:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498555752; cv=none; d=google.com; s=arc-20160816; b=poUudeq8N6mdSxQz1CzcY3loHjw2yrXpbXnuIni9w9raYgpTGuu0cgLBbgndU0ua21 i1MicbVKIi6B0K+jRtbrya7HHHStnTqRhlrGaNr2kGPeCN4afFAgQ6j+yIiSAvCZTPth lnqH7oNl2qqNmh8+DW7dYuQn6QOaRJ9t3x6TQslhFri0kBqklp197X/szxlFk7dD8Pxc tXGGlbYE63AYkng/qAoSSWtQe4U79Uxw07xo1zmQKMTTOoffFNFxZjklkuiaWelsIQpS /CpVcC+HMwJfViD7Nwg//9BHQdYp/DvlaTBd9fSSpj++C8LiNfqsU51USbo5uWfQgzqu 04sg== 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:arc-authentication-results; bh=8orf4WOYqXGvcg504GNypjI8e3BqmZ+VxoGuYxwyolE=; b=WFP0LpcMebW8v4YliAfuFWOEMXeEwWgygIqa8qk2stGFkKXb3k3LRblzvXYHkXgiFe RmYFUwTuJa+sZuZbZ1iyjKjUa0Z6wpkd9I1yeS33RWfKC404/+Xsg53HoQqK72HNrWYn 6HmuRjm9AIRNHgCtYIp4u94ii+T0ZwqPV6Y/GEWQBowCArI6qf6joMpDFBoDmEt8/Z8v NLw153j/CZB9JOZNYvWY2vic140B7AeY70wz0L3kNBB39vt9GIXBzZlBI0tE8GQmHkKB rjY63Rr8IjzHtXvn36MKuMITFtbkc5fbo1L3eGbKG14Ymj4qd+ARm5IQvO0udYfZSwRZ iUPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=R7GnIvZA; 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 s80si1603828pfs.171.2017.06.27.02.29.11; Tue, 27 Jun 2017 02:29:12 -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=pass header.i=@linaro.org header.b=R7GnIvZA; 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 S1752684AbdF0J3K (ORCPT + 25 others); Tue, 27 Jun 2017 05:29:10 -0400 Received: from mail-wm0-f47.google.com ([74.125.82.47]:36649 "EHLO mail-wm0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752389AbdF0J2d (ORCPT ); Tue, 27 Jun 2017 05:28:33 -0400 Received: by mail-wm0-f47.google.com with SMTP id 62so19023643wmw.1 for ; Tue, 27 Jun 2017 02:28:32 -0700 (PDT) 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=8orf4WOYqXGvcg504GNypjI8e3BqmZ+VxoGuYxwyolE=; b=R7GnIvZAfMUZ8ugbrKWLOlOi6ysdRyG2aiaCZ71AXkDJXjmKhUn6kje2VuFzkNE7Zq 9exowuNeOHHQAwgApvQ9d6qbqJ0KIh5hXioqG7xhtiqR6635J3c3Qk59PYDYxNGU3oLv LqTY921Etelzdv0mDDYcABnbejUlNIX8IoEq4= 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=8orf4WOYqXGvcg504GNypjI8e3BqmZ+VxoGuYxwyolE=; b=JJi08ggg2qDU9g1wmqRGqzVWKgjQQIaixKLakAHhBVFSsPxg5N7xS744E9fQaq+h6y z9fzyM9INO81UIrZ5l9NEndDT9o/b+YDCtisjms5eFvfTbYaZIgEde5fHR6LnGuo9I9A nkn6PdE78KkI14MXOu40SfvM7tCtQKjkSmagjd1noIiIS9nb5e22YRS750wUMMMFC8+8 xF4TzdCbANk9e5xWluAFgaEd4dtVCyGt1uuguwarx0ecj2fSVbZyddAFAIIWiFuB0Lte UqG2vf2Veay+llWXlhQBx8EfN/uukJ75Nu+vVOasW/XhbKK4TDwhF2KH4D8b77gWP2/3 yI/Q== X-Gm-Message-State: AKS2vOwfL3/pDCHzkmqHZiHfewFNBxnFpV9D2yXqO33ptOMOHDOvtSC7 V4qP+XPGY4UzPCXZ X-Received: by 10.28.136.129 with SMTP id k123mr2437256wmd.14.1498555711355; Tue, 27 Jun 2017 02:28:31 -0700 (PDT) Received: from localhost.localdomain ([2a01:e35:879a:6cd0:110f:661:6b72:192e]) by smtp.gmail.com with ESMTPSA id g2sm16159798wrg.69.2017.06.27.02.28.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 27 Jun 2017 02:28:30 -0700 (PDT) From: Daniel Lezcano To: tglx@linutronix.de Cc: linux-kernel@vger.kernel.org, Christophe Jaillet Subject: [PATCH 5/5] clocksource/drivers/mips-gic-timer: Fix an error code in 'gic_clocksource_of_init()' Date: Tue, 27 Jun 2017 11:27:00 +0200 Message-Id: <1498555620-25094-5-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1498555620-25094-1-git-send-email-daniel.lezcano@linaro.org> References: <20170627092239.GE2479@mai> <1498555620-25094-1-git-send-email-daniel.lezcano@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Christophe Jaillet 'clk' is a valid pointer at this point. So calling PTR_ERR on it is pointess. Return the error code from 'clk_prepare_enable()' if it fails instead. Signed-off-by: Christophe JAILLET Signed-off-by: Daniel Lezcano --- drivers/clocksource/mips-gic-timer.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- 2.7.4 diff --git a/drivers/clocksource/mips-gic-timer.c b/drivers/clocksource/mips-gic-timer.c index e31e083..17b861e 100644 --- a/drivers/clocksource/mips-gic-timer.c +++ b/drivers/clocksource/mips-gic-timer.c @@ -167,10 +167,11 @@ static int __init gic_clocksource_of_init(struct device_node *node) clk = of_clk_get(node, 0); if (!IS_ERR(clk)) { - if (clk_prepare_enable(clk) < 0) { + ret = clk_prepare_enable(clk); + if (ret < 0) { pr_err("GIC failed to enable clock\n"); clk_put(clk); - return PTR_ERR(clk); + return ret; } gic_frequency = clk_get_rate(clk);