From patchwork Fri Nov 28 09:43:58 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 41671 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 66571244C2 for ; Fri, 28 Nov 2014 09:44:57 +0000 (UTC) Received: by mail-wi0-f200.google.com with SMTP id ex7sf4052176wid.7 for ; Fri, 28 Nov 2014 01:44:56 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:in-reply-to:references :sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=8ufi11tnmOFQ0DjKVrF6o0k1WfO5anJToc2EDkDV7YE=; b=TFDpCIR05I8uqxfBY3Wdg55jpiImGFWrvYUjD3jX4drmVgFD+/qPrd7Klf1AiRLMBl zF0HrOE3C/MUPlluVDTmGVERN+L8jGN27MElPN1/Iw9o3mWTvlLzzcVpX5FAE4vVY4EI VB8IClFgP7nxq2y4JWrGNYaIwI+1B9UgXSNi0RLXtMdnPeOip5d618vSnHcfKC+v0vYM YvP+0gDpYRrMphFJhOSZSvRtIyxOeljOXlhf9V2dW4pvGvVdGyL9Pt6TLjTQ3dyvALus fRAGTLdBR2gVtEThBLMBdT9hoCrZtrDrpnIaGUq442Mq4fjo/z/itR6fo9bUdgxeaduN 9JNw== X-Gm-Message-State: ALoCoQnsf5G3K6/nL3vwOml6x82fTtQQ/bWhKdC+UOL/TIdVbmp3GK/z3Uc+F13spY47WnscFDYe X-Received: by 10.112.162.199 with SMTP id yc7mr23410lbb.23.1417167896715; Fri, 28 Nov 2014 01:44:56 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.134 with SMTP id s6ls766207las.27.gmail; Fri, 28 Nov 2014 01:44:56 -0800 (PST) X-Received: by 10.112.162.41 with SMTP id xx9mr42232192lbb.21.1417167896569; Fri, 28 Nov 2014 01:44:56 -0800 (PST) Received: from mail-lb0-f173.google.com (mail-lb0-f173.google.com. [209.85.217.173]) by mx.google.com with ESMTPS id b8si9420789laf.116.2014.11.28.01.44.56 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 28 Nov 2014 01:44:56 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.173 as permitted sender) client-ip=209.85.217.173; Received: by mail-lb0-f173.google.com with SMTP id z12so5330131lbi.18 for ; Fri, 28 Nov 2014 01:44:56 -0800 (PST) X-Received: by 10.152.8.170 with SMTP id s10mr42863542laa.56.1417167896436; Fri, 28 Nov 2014 01:44:56 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.184.201 with SMTP id ew9csp60373lbc; Fri, 28 Nov 2014 01:44:55 -0800 (PST) X-Received: by 10.68.255.195 with SMTP id as3mr72162006pbd.38.1417167894668; Fri, 28 Nov 2014 01:44:54 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id vj10si15336419pbc.138.2014.11.28.01.44.53 for ; Fri, 28 Nov 2014 01:44:54 -0800 (PST) Received-SPF: none (google.com: linux-pm-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751658AbaK1Jox (ORCPT + 12 others); Fri, 28 Nov 2014 04:44:53 -0500 Received: from mail-pd0-f173.google.com ([209.85.192.173]:58990 "EHLO mail-pd0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751605AbaK1Jow (ORCPT ); Fri, 28 Nov 2014 04:44:52 -0500 Received: by mail-pd0-f173.google.com with SMTP id ft15so6411677pdb.4 for ; Fri, 28 Nov 2014 01:44:52 -0800 (PST) X-Received: by 10.66.140.8 with SMTP id rc8mr72259618pab.83.1417167892039; Fri, 28 Nov 2014 01:44:52 -0800 (PST) Received: from localhost ([122.167.111.40]) by mx.google.com with ESMTPSA id ir2sm9343047pbc.57.2014.11.28.01.44.50 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 28 Nov 2014 01:44:51 -0800 (PST) From: Viresh Kumar To: linux-pm@vger.kernel.org, edubezval@gmail.com Cc: linaro-kernel@lists.linaro.org, rui.zhang@intel.com, Viresh Kumar , Chanwoo Choi , Kyungmin Park , Amit Daniel Kachhap , Lukasz Majewski Subject: [PATCH 04/26] thermal: exynos: Handle -EPROBE_DEFER properly Date: Fri, 28 Nov 2014 15:13:58 +0530 Message-Id: <79bbedd743bdd82f37a578ece26359432ddccc72.1417167599.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.0.3.693.g996b0fd In-Reply-To: References: In-Reply-To: References: Sender: linux-pm-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.173 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , cpufreq_cooling_register() can return -EPROBE_DEFER if cpufreq driver isn't ready yet and so the callers must defer their initialization. Exynos thermal drivers weren't handling this well and were raising false error message when -EPROBE_DEFER is returned to them. Fix them to handle -EPROBE_DEFER. Cc: Chanwoo Choi Cc: Kyungmin Park Cc: Amit Daniel Kachhap Cc: Lukasz Majewski Signed-off-by: Viresh Kumar --- drivers/thermal/samsung/exynos_thermal_common.c | 7 ++++--- drivers/thermal/samsung/exynos_tmu.c | 4 +++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/thermal/samsung/exynos_thermal_common.c b/drivers/thermal/samsung/exynos_thermal_common.c index bf39212..0be1d54 100644 --- a/drivers/thermal/samsung/exynos_thermal_common.c +++ b/drivers/thermal/samsung/exynos_thermal_common.c @@ -369,9 +369,10 @@ int exynos_register_thermal(struct thermal_sensor_conf *sensor_conf) th_zone->cool_dev[th_zone->cool_dev_size] = cpufreq_cooling_register(cpu_present_mask); if (IS_ERR(th_zone->cool_dev[th_zone->cool_dev_size])) { - dev_err(sensor_conf->dev, - "Failed to register cpufreq cooling device\n"); - ret = -EINVAL; + ret = PTR_ERR(th_zone->cool_dev[th_zone->cool_dev_size]); + if (ret != -EPROBE_DEFER) + dev_err(sensor_conf->dev, + "Failed to register cpufreq cooling device\n"); goto err_unregister; } th_zone->cool_dev_size++; diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index 49c0924..cc3677f 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c @@ -683,7 +683,9 @@ static int exynos_tmu_probe(struct platform_device *pdev) /* Register the sensor with thermal management interface */ ret = exynos_register_thermal(sensor_conf); if (ret) { - dev_err(&pdev->dev, "Failed to register thermal interface\n"); + if (ret != -EPROBE_DEFER) + dev_err(&pdev->dev, + "Failed to register thermal interface\n"); goto err_clk; } data->reg_conf = sensor_conf;