From patchwork Thu Apr 26 08:53:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 134430 Delivered-To: patches@linaro.org Received: by 10.46.151.6 with SMTP id r6csp1973394lji; Thu, 26 Apr 2018 01:53:25 -0700 (PDT) X-Received: by 10.46.83.68 with SMTP id t4mr15260164ljd.83.1524732805521; Thu, 26 Apr 2018 01:53:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524732805; cv=none; d=google.com; s=arc-20160816; b=m2x1Ypo8OHERtgcDENNfUP36tYjKECmVIsyEIyxvmkFL472rt4eybdJi5v7cso/wb3 nCOkLwYTIaW3n55OI+iTYnCDhUGCO23Z8wlwuW6ngSOOCdFV3HjuMJMgitml6LPnJUVE FWLT7dJ8r4LJracOXSM+XId4PSiRHgW9SML063HE0HSKrFh+glok1ZyjuJmtNpd2dbNx 59ht+10KshVXCRkNJ5+kUjSO/bEWHHszEtLsoh2+m3DpY+mpGTXHdoU291itHNHutIbK 9Z4AM1LSGO3FN1VJmCdPHI0UVwsU6yf/mOk/mN3PWCf66G/s3TDHHPSrdeyCp2KYaLVi jJCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=H5Anx8HHtixBsfJHQkkyvqYQI+3r9uHRYHoqlZJ0xFo=; b=0Rjk5Ou7fjyty92jjNCZcooxpIWJo2CiuIGWBRbj1bPAbgPcLHVbh1XlyrYsrYErDZ J2dlwTWVzHO1WPol5bKsyd8hrr329MmUeA4TNXcfZqtTdkXgrp2ylJUw9FpvtH2JXrdI l4UXAUoVaDTc6XrzjNvYwcBVCobW5lWpjucKaK52FhpZwH58+3x00Pm2t8+s6ldgzlHH GQZhXHL0J1K2TmPOKtycFEPtBl+Bj0yjGxDl5JIOSWNXKShXhDDWwvcbmqrYcAbiotXH c8uEyP9EokAtyokJQJgwFjwpwp2/no4wzMAUyLlfs/gHi8lsSH7EkHNJ6ZSRjqXIKLL/ oJcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YdPW6sbQ; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id 95-v6sor1190982lfs.68.2018.04.26.01.53.25 for (Google Transport Security); Thu, 26 Apr 2018 01:53:25 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YdPW6sbQ; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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=H5Anx8HHtixBsfJHQkkyvqYQI+3r9uHRYHoqlZJ0xFo=; b=YdPW6sbQPY8Muux5gkatKh561Txo8eyhKxXlPQ8jkQ58z67Q639FkquWzMa+en0XeL DA9GalT/t8Yks8vsnzSB9hhLGn6oEvCHyqz8x3NYrChLmnxv4/rfXTI7R3wXqEhgNg// S1L8IU5RI9UEGk5XLjEc+S0Kgqr4EVd/1K4YY= 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=H5Anx8HHtixBsfJHQkkyvqYQI+3r9uHRYHoqlZJ0xFo=; b=dbdhDiYhC8RFaSwyZvyOxUe9XZ7bdStpfAcAw3PkoKHWiU1urU24zimHdJO6ni2BVJ 0+a2OymvHDcAGDHFVAOGPSj8Vi21GhCIvFcZ1rHt/yvRkh9SaSuzBh+FdvupefFtpV7x u725c0vD5tp6nXbUdiBbx48tXf+ZPmfETQUH++WFdWbhgtleMdPXbPUUTFxULzvnAPmv gxvkwYSR3pHD+LWedyVxTTPM/qkl1P+HrJ0m9gXo+FSdqJPDIksGxWxWYMN93F2oJDBy cjQGLTepiHWpZdTMk8oW69JtTEZdQcNi7c1SapU4rp6T/JNBYfSMQLbydYv7wO4HKEts 6jZg== X-Gm-Message-State: ALQs6tCzIYVj2Q7wwOSY3fq87cMzlUAj6RT5DBFFM81Lx70F/db+WHTt nzj6EUEN8gvMmlN2wo587Mwe6fXG X-Google-Smtp-Source: AB8JxZq8Upp3SruXHrnUeX4byXevOhdkpWfiIciJPXCcvr+cFZc5+nFzRwL9rxyhIE/fhbS4O8MBnw== X-Received: by 2002:a19:b587:: with SMTP id g7-v6mr16791341lfk.90.1524732805294; Thu, 26 Apr 2018 01:53:25 -0700 (PDT) Return-Path: Received: from localhost.localdomain (h-158-174-22-210.NA.cust.bahnhof.se. [158.174.22.210]) by smtp.gmail.com with ESMTPSA id u83-v6sm681097lff.65.2018.04.26.01.53.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 26 Apr 2018 01:53:24 -0700 (PDT) From: Ulf Hansson To: "Rafael J . Wysocki" , Greg Kroah-Hartman , linux-pm@vger.kernel.org Cc: Ulf Hansson , Kevin Hilman , Geert Uytterhoeven , Viresh Kumar , Vincent Guittot , Mark Brown , Vinod Koul , Sanyog Kale , Pierre-Louis Bossart , Wolfram Sang , Russell King , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 07/11] driver core: Respect all error codes from dev_pm_domain_attach() Date: Thu, 26 Apr 2018 10:53:06 +0200 Message-Id: <1524732790-2234-8-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1524732790-2234-1-git-send-email-ulf.hansson@linaro.org> References: <1524732790-2234-1-git-send-email-ulf.hansson@linaro.org> The limitation of being able to check only for -EPROBE_DEFER from dev_pm_domain_attach() has been removed. Hence let's respect all error codes and bail out accordingly. Cc: Greg Kroah-Hartman Signed-off-by: Ulf Hansson --- drivers/base/platform.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) -- 2.7.4 diff --git a/drivers/base/platform.c b/drivers/base/platform.c index 8075ddc..9460139 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c @@ -572,17 +572,16 @@ static int platform_drv_probe(struct device *_dev) return ret; ret = dev_pm_domain_attach(_dev, true); - if (ret != -EPROBE_DEFER) { - if (drv->probe) { - ret = drv->probe(dev); - if (ret) - dev_pm_domain_detach(_dev, true); - } else { - /* don't fail if just dev_pm_domain_attach failed */ - ret = 0; - } + if (ret) + goto out; + + if (drv->probe) { + ret = drv->probe(dev); + if (ret) + dev_pm_domain_detach(_dev, true); } +out: if (drv->prevent_deferred_probe && ret == -EPROBE_DEFER) { dev_warn(_dev, "probe deferral not supported\n"); ret = -ENXIO;