From patchwork Sun Oct 18 11:01:48 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 7429821 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id BCFE99F37F for ; Sun, 18 Oct 2015 11:26:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E4F2A20708 for ; Sun, 18 Oct 2015 11:26:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 08ED420700 for ; Sun, 18 Oct 2015 11:26:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752370AbbJRL0s (ORCPT ); Sun, 18 Oct 2015 07:26:48 -0400 Received: from mail-wi0-f178.google.com ([209.85.212.178]:37638 "EHLO mail-wi0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752304AbbJRL0r (ORCPT ); Sun, 18 Oct 2015 07:26:47 -0400 Received: by wicfv8 with SMTP id fv8so42523627wic.0 for ; Sun, 18 Oct 2015 04:26:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:subject:to:cc:message-id:date:user-agent:mime-version :content-type:content-transfer-encoding; bh=yutG0qUJCQAjpijTAoV4CuvPYT58Tu7wYrJnVIUz2kc=; b=sVHwOXr+JXR/eVraXRU/eKzXEILgBgcHWmblt5YvX63ATQ7qq9/ABEdEfSAmLgXkBt Ku9By6APTFLhcS88wehVCLzIcBF+gSsnx0WdqNMj4VIsjgFEdwf/6MS8lUKKObMIz9k2 6dOrgWBo+GIV2JO3B+3sq4m9OynL+20NqetsSeH9jsoBW0rXjPs2jpQOAwtToqsTHmXa 652VS/p1WbURpFu+aZRHG5nMakX68LO9YPkKeBuOybE0okIwO/NZMJWNpNiMNdBwWwVn hZmhcc9wmGxGvZype8k7uuaV+nB4YgUUCcLW5+K3GwtXw3aC2ENsAtGJCbpfwtpFDHRe DUrA== X-Received: by 10.195.11.40 with SMTP id ef8mr27537475wjd.103.1445167606256; Sun, 18 Oct 2015 04:26:46 -0700 (PDT) Received: from ?IPv6:2003:62:5f55:ba00:6133:c885:85ff:fb69? (p200300625F55BA006133C88585FFFB69.dip0.t-ipconnect.de. [2003:62:5f55:ba00:6133:c885:85ff:fb69]) by smtp.googlemail.com with ESMTPSA id bf8sm33558894wjc.22.2015.10.18.04.26.45 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 18 Oct 2015 04:26:45 -0700 (PDT) From: Heiner Kallweit Subject: [PATCH 1/2] cpufreq: imx: fix regulator_get error handling To: Viresh Kumar , "Rafael J. Wysocki" Cc: linux-pm@vger.kernel.org Message-ID: <56237C1C.80109@gmail.com> Date: Sun, 18 Oct 2015 13:01:48 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP With CONFIG_DELAY_DEVICE_PROBES being set I get the following error: cpu cpu0: failed to get regulators imx6q-cpufreq: probe of imx6q-cpufreq.0 failed with error -2 Fix the error handling of regulator_get to properly deal with -EPROBE_DEFER. Signed-off-by: Heiner Kallweit Acked-by: Viresh Kumar --- drivers/cpufreq/imx6q-cpufreq.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/cpufreq/imx6q-cpufreq.c b/drivers/cpufreq/imx6q-cpufreq.c index 380a90d..0bb33dc 100644 --- a/drivers/cpufreq/imx6q-cpufreq.c +++ b/drivers/cpufreq/imx6q-cpufreq.c @@ -187,11 +187,20 @@ static int imx6q_cpufreq_probe(struct platform_device *pdev) } arm_reg = regulator_get(cpu_dev, "arm"); + if (IS_ERR(arm_reg)) { + ret = PTR_ERR(arm_reg); + if (ret != -EPROBE_DEFER) + dev_err(cpu_dev, "failed to get regulator arm\n"); + goto put_reg; + } + pu_reg = regulator_get_optional(cpu_dev, "pu"); + soc_reg = regulator_get(cpu_dev, "soc"); - if (IS_ERR(arm_reg) || IS_ERR(soc_reg)) { - dev_err(cpu_dev, "failed to get regulators\n"); - ret = -ENOENT; + if (IS_ERR(soc_reg)) { + ret = PTR_ERR(soc_reg); + if (ret != -EPROBE_DEFER) + dev_err(cpu_dev, "failed to get regulator soc\n"); goto put_reg; }