From patchwork Fri Jan 4 16:59:56 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 1933961 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 2D7E23FF0F for ; Fri, 4 Jan 2013 17:03:34 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TrAcu-0006At-Ht; Fri, 04 Jan 2013 17:00:12 +0000 Received: from mail-we0-f172.google.com ([74.125.82.172]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TrAco-000699-A8 for linux-arm-kernel@lists.infradead.org; Fri, 04 Jan 2013 17:00:07 +0000 Received: by mail-we0-f172.google.com with SMTP id r3so8003302wey.3 for ; Fri, 04 Jan 2013 09:00:04 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=PxoZ7JVlnq7Q9WgN7BYauedQa9Cv/yymcaVGUiIm78E=; b=fTVbVvANAjczo8wyAcg6XFSs3MzV+nWUzxZoeuyCJ/tkcSjlZFGWZLeG06ZvPvPOy7 cQ6MP0RL0dHUxBPk0FRfrDDnaFbxBHc/281SjP4tTOLIgoxVYxiOBa25NMc5G3oYAedB QxxfEgNZz0RD7TE88IfJEReyq5GP0HCdfZRxrvkhuNzazKJbhBnCEgYmhceIdga2HN+O nYaD55oo0W8M8CVcO9G8v6L+ZbqNtLG69hOS+zAVcNjyAQ0WwchMuxGjPqScyX3tr1jD X2kEGTq7qS/WYYUJVoQf3+4IXvl3jt3QfXP7Kx/n8KsfBOT48ADJVHgY7uxeK9BmZzuK lEZg== X-Received: by 10.194.76.137 with SMTP id k9mr85187022wjw.29.1357318804673; Fri, 04 Jan 2013 09:00:04 -0800 (PST) Received: from mai.home (AToulouse-654-1-322-234.w86-199.abo.wanadoo.fr. [86.199.209.234]) by mx.google.com with ESMTPS id t17sm91133761wiv.6.2013.01.04.09.00.02 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 04 Jan 2013 09:00:03 -0800 (PST) From: Daniel Lezcano To: kgene.kim@samsung.com Subject: [PATCH 2/5] ARM: exynos: handle properly the return values Date: Fri, 4 Jan 2013 17:59:56 +0100 Message-Id: <1357318799-24378-2-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1357318799-24378-1-git-send-email-daniel.lezcano@linaro.org> References: <1357318799-24378-1-git-send-email-daniel.lezcano@linaro.org> X-Gm-Message-State: ALoCoQlZt777poOCO6g8gj4xhXk6RjThUDtk3G3sgWD8wN1DbT1UHPRcUF2pVkmYi4qw9tXa7Mnn X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130104_120006_520585_8371AEBF X-CRM114-Status: GOOD ( 14.19 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [74.125.82.172 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: linux-samsung-soc@vger.kernel.org, linaro-dev@lists.linaro.org, linux-arm-kernel@lists.infradead.org, patches@linaro.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org The cpuidle_register_driver return value is not checked. The init function returns always -EIO when cpuidle_register_device fails but the error could be different. This patch fixes that by checking the cpuidle_register_driver properly and returning the correct value when cpuidle_register_device fails. Signed-off-by: Daniel Lezcano --- arch/arm/mach-exynos/cpuidle.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/arch/arm/mach-exynos/cpuidle.c b/arch/arm/mach-exynos/cpuidle.c index f8dd1cd..a5fe194 100644 --- a/arch/arm/mach-exynos/cpuidle.c +++ b/arch/arm/mach-exynos/cpuidle.c @@ -193,13 +193,17 @@ static void __init exynos5_core_down_clk(void) static int __init exynos4_init_cpuidle(void) { - int cpu_id; + int cpu_id, ret; struct cpuidle_device *device; if (soc_is_exynos5250()) exynos5_core_down_clk(); - cpuidle_register_driver(&exynos4_idle_driver); + ret = cpuidle_register_driver(&exynos4_idle_driver); + if (ret) { + printk(KERN_ERR "CPUidle failed to register driver\n"); + return ret; + } for_each_cpu(cpu_id, cpu_online_mask) { device = &per_cpu(exynos4_cpuidle_device, cpu_id); @@ -209,9 +213,10 @@ static int __init exynos4_init_cpuidle(void) if (cpu_id != 0) device->state_count = 1; - if (cpuidle_register_device(device)) { - printk(KERN_ERR "CPUidle register device failed\n,"); - return -EIO; + ret = cpuidle_register_device(device); + if (ret) { + printk(KERN_ERR "CPUidle register device failed\n"); + return ret; } }