From patchwork Thu Apr 26 08:53:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 10365019 X-Patchwork-Delegate: rjw@sisk.pl Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1AFFB60547 for ; Thu, 26 Apr 2018 08:54:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0BD702907F for ; Thu, 26 Apr 2018 08:54:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 009F82908D; Thu, 26 Apr 2018 08:54:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DF37F2907F for ; Thu, 26 Apr 2018 08:54:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754920AbeDZIyk (ORCPT ); Thu, 26 Apr 2018 04:54:40 -0400 Received: from mail-lf0-f68.google.com ([209.85.215.68]:42948 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754773AbeDZIxa (ORCPT ); Thu, 26 Apr 2018 04:53:30 -0400 Received: by mail-lf0-f68.google.com with SMTP id u21-v6so27923440lfu.9 for ; Thu, 26 Apr 2018 01:53:29 -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=rlrpHb/IeX5xP3SDTjra/zpY68YkXnTDM31XH0nhg+w=; b=erboZ726gLb32PLZTg+zkx7X3M1NsEd2Otmi4MtLIBl3FQu2qsH7HMyqy7gOY0SR1h Ztof8dJRE3lAPsjQgjMQR8jGHKjRKqeDmJW5ZnLfam6z+EcJMru4RBZ1wm7kU6t7TDmV xXrEujyGJp6nko5wdATO1OR8cqgvGnCGmYo2E= 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=rlrpHb/IeX5xP3SDTjra/zpY68YkXnTDM31XH0nhg+w=; b=q8uvmB9fLSY/X+YeRxYdyhZ2HxBwP2rnDldNIvV7oB2zlx1fmndkjczqi4c2vUDFn8 Q/Y7VdXPXhRXy59VfTa4GB3x+KsZYC72svjUllPlKO4DebsQ2LjHtioLeDrvU1VK+0Ec K6GkbCKP4VVpl1YwQRp3sDTYo+mwT9uyJskgcimcvz5v16zXnYLb4E2Lm4sti6nyPMBV WxyNDavkIBMI9aKEbVuvMFWLUsP4IvsTwSqbpSqd9L3avh5EdBsiHfGz7BHI7SQ6w4hg L8IJkUmtvGwlpYYVIoHZ6iWePW0E/2hc9IJR/nH2/puOG+2m9OqYxFVOMzCEEoVvH1aG YV7A== X-Gm-Message-State: ALQs6tBWmv3rzocRoyvQazFtFj7snWupWV4wPuu0gE4TiGAj9gxpVivg vBwfihYA5k43cBRUIzuVRr8NXQ== X-Google-Smtp-Source: AB8JxZo4zVxcacJ9yKjlB/IJFq/AqR9WWf+d4AGgC5HSHcYgPfMP7Tn5imDu+bDc+/qfDi1F25griA== X-Received: by 2002:a19:8dd4:: with SMTP id p203-v6mr3651009lfd.137.1524732809021; Thu, 26 Apr 2018 01:53:29 -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.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 26 Apr 2018 01:53:28 -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 10/11] soundwire: Respect all error codes from dev_pm_domain_attach() Date: Thu, 26 Apr 2018 10:53:09 +0200 Message-Id: <1524732790-2234-11-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-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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: Vinod Koul Cc: Sanyog Kale Cc: Pierre-Louis Bossart Signed-off-by: Ulf Hansson Acked-by: Vinod Koul --- drivers/soundwire/bus_type.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/soundwire/bus_type.c b/drivers/soundwire/bus_type.c index d5f3a70..283b283 100644 --- a/drivers/soundwire/bus_type.c +++ b/drivers/soundwire/bus_type.c @@ -83,17 +83,16 @@ static int sdw_drv_probe(struct device *dev) * attach to power domain but don't turn on (last arg) */ ret = dev_pm_domain_attach(dev, false); - if (ret != -EPROBE_DEFER) { - ret = drv->probe(slave, id); - if (ret) { - dev_err(dev, "Probe of %s failed: %d\n", drv->name, ret); - dev_pm_domain_detach(dev, false); - } - } - if (ret) return ret; + ret = drv->probe(slave, id); + if (ret) { + dev_err(dev, "Probe of %s failed: %d\n", drv->name, ret); + dev_pm_domain_detach(dev, false); + return ret; + } + /* device is probed so let's read the properties now */ if (slave->ops && slave->ops->read_prop) slave->ops->read_prop(slave);