Received: by 10.192.165.148 with SMTP id m20csp1770651imm; Thu, 26 Apr 2018 01:55:13 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpr2huFZHLRdW51fMWOd/Y4yJ95Ka0++YH9vsaswHWPxNewF40l7lRv0rHujP5TcGAwlxlY X-Received: by 10.101.80.199 with SMTP id s7mr6708413pgp.192.1524732913262; Thu, 26 Apr 2018 01:55:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524732913; cv=none; d=google.com; s=arc-20160816; b=m7RDu5jtxCgDrRnf0WpjGzgAbB7f1AmIzsxHSsK7xlhZRJiJDh5mEsqi6aoenb6wwj ZRHTuXxsKYpb3C3fsHmUjoMUoGtuceXTroIOu37YpGnyM3iH+yS43engUiMwiw7/DhQB Xiqx7IZ0qhi4/n2745SM1HOBT0kW8RRBPRLnFuXSBAtrUmW5BszR+Bl7GQdi18WRO5lI 6bkd3jt7UAMgwYLIdwH+sVnm0dKTSE8S+ranEn/N82T/U9eGzKZjFbEC1rhQvBzARzMy EGdDex8AKkxLvwULqiI6BP9vStIjM/z4lyod1AcAOwKfCnjbryUhhB/WfCgQRZ8Aw2Wf 9RAQ== 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=H5Anx8HHtixBsfJHQkkyvqYQI+3r9uHRYHoqlZJ0xFo=; b=HXqW9JRU8IcnR7DKIjy9+et0CAXdIIoXpeNr9PSWxKVixYNIM4Xprd8BqSy6YzEX3E 5Yl1DquL55IeANX5J2BRiin2YmZiJKcw2NKHy3sCtOkUmTwYrrtas58JcBLusk+e0U0y uHTnUPHrXr/wp7Qyi9sGVdEGrMf0Uhcwc5ij7BbqqL0RMmxC8Ty5v+yTYSjqOh7v4Nrk jC1o/j2WiR80jerZvMjmXQlXJf6uTmu/+2MlXxz+CHcKqd+8+A/eMpKmO2j61GFpH+50 h+bBuDK3yXGIGFbX52YmVX1jaWFEHrzfkPxsvYiY27GnfETYlKY67SXK3LpgTLOgUkQK V44g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YdPW6sbQ; 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 h10-v6si5310973pll.425.2018.04.26.01.54.59; Thu, 26 Apr 2018 01:55:13 -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.s=google header.b=YdPW6sbQ; 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 S1754867AbeDZIxk (ORCPT + 99 others); Thu, 26 Apr 2018 04:53:40 -0400 Received: from mail-lf0-f68.google.com ([209.85.215.68]:39463 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754747AbeDZIx0 (ORCPT ); Thu, 26 Apr 2018 04:53:26 -0400 Received: by mail-lf0-f68.google.com with SMTP id j193-v6so6522622lfg.6 for ; Thu, 26 Apr 2018 01:53:26 -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=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=VHMGkL+SUjlYpZj4OJwmEpOfomYXxD0YJeHVL7gLxxQr9hAex/kHPukuW4ppHHAn9K AB6CbN5mFJ5neMhWwQ5AJzuoWG5eyik4XrrvJlzEaEQixaCQZh8WmenHbgBBL+1WL6qe odx+pbJ9tmy3HRGmCRKmWOv0YCKkjZUkqfpjHlOrKKGwEsGsrxKkntLv+oha3seoKHyZ tz6Hni4c5ACuBYXEzmXSiw1HXrorV+MrY8HVg6H70BzvV3Djsqj/i3DUhqNt9wwElegV QFzDB+evxG2klqq7+NCZQgvBeE2N2qaoLzHD60/382XO+MO48AqcdDiQsSM2cQ9t/esh lbfw== X-Gm-Message-State: ALQs6tCP0EceBJdnTuPn+sLHRwNsb7/L5mc1cvMqcDF3U5Lawc0qTiPI d4yyf/6+1Gyv1ks6d2bT9MLb7g== X-Received: by 2002:a19:b587:: with SMTP id g7-v6mr16791341lfk.90.1524732805294; Thu, 26 Apr 2018 01:53:25 -0700 (PDT) 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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(-) 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; -- 2.7.4