From patchwork Tue Aug 26 12:07:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 36003 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yk0-f198.google.com (mail-yk0-f198.google.com [209.85.160.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 877D02054F for ; Tue, 26 Aug 2014 12:07:58 +0000 (UTC) Received: by mail-yk0-f198.google.com with SMTP id q200sf48763388ykb.9 for ; Tue, 26 Aug 2014 05:07:58 -0700 (PDT) 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:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=1a+t/y1uibRU+C2JVaLgtJz0/iaJh7KomrCMDJMS7m0=; b=IGUE8WFHoXrIiDEMbWgKzDAjfBgrN23xhWUJ/ByPyE5rB3jHOsk1MTp2aUWLdnOOHp 0PjnwrKM7jkz1e4r+zxF7CCjquNmzu3CQQKqOO7R/oWx/DThSVnCR8v2OrcZHNo5AvxZ Q4eWVTKcWRK/EywMI1uTxheCmjr6oBGL96YT96sSJiNmDvANYVxyxpgDVD6ce3osqqLR nArWK0znoPRCJOUJr9VJKgZ32EN6bS/V/sg7oxliV1vk2L9CjTBp/GTgW0p+XzQrSdg/ K+EQvibbzHWfITd2yJ89qTtFRYaok40dv17qJfQWz7HwYPs7d/iPm2icfLH+fQx7GplH roKw== X-Gm-Message-State: ALoCoQlRM+Du6Z3ejbcD3xpsOh0F4zuNq8Asg7opcWMC1b/VtAeZskm05knJ/vfk7zFWnuYfjFyi X-Received: by 10.224.67.135 with SMTP id r7mr4366454qai.5.1409054878347; Tue, 26 Aug 2014 05:07:58 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.109.246 with SMTP id l109ls2700599qgf.1.gmail; Tue, 26 Aug 2014 05:07:58 -0700 (PDT) X-Received: by 10.220.169.72 with SMTP id x8mr708077vcy.45.1409054878178; Tue, 26 Aug 2014 05:07:58 -0700 (PDT) Received: from mail-vc0-f176.google.com (mail-vc0-f176.google.com [209.85.220.176]) by mx.google.com with ESMTPS id yq20si1262755vdb.38.2014.08.26.05.07.58 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 26 Aug 2014 05:07:58 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.176 as permitted sender) client-ip=209.85.220.176; Received: by mail-vc0-f176.google.com with SMTP id id10so16593565vcb.35 for ; Tue, 26 Aug 2014 05:07:58 -0700 (PDT) X-Received: by 10.52.0.132 with SMTP id 4mr7860772vde.10.1409054878094; Tue, 26 Aug 2014 05:07:58 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.221.45.67 with SMTP id uj3csp193035vcb; Tue, 26 Aug 2014 05:07:57 -0700 (PDT) X-Received: by 10.112.158.199 with SMTP id ww7mr26070440lbb.71.1409054876783; Tue, 26 Aug 2014 05:07:56 -0700 (PDT) Received: from mail-la0-f45.google.com (mail-la0-f45.google.com [209.85.215.45]) by mx.google.com with ESMTPS id v10si3303824lav.68.2014.08.26.05.07.56 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 26 Aug 2014 05:07:56 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.215.45 as permitted sender) client-ip=209.85.215.45; Received: by mail-la0-f45.google.com with SMTP id ty20so14861432lab.4 for ; Tue, 26 Aug 2014 05:07:56 -0700 (PDT) X-Received: by 10.152.42.136 with SMTP id o8mr14261672lal.76.1409054876235; Tue, 26 Aug 2014 05:07:56 -0700 (PDT) Received: from uffe-Latitude-E6430s.lan (90-231-160-185-no158.tbcn.telia.com. [90.231.160.185]) by mx.google.com with ESMTPSA id ai1sm4908979lbd.12.2014.08.26.05.07.54 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 26 Aug 2014 05:07:55 -0700 (PDT) From: Ulf Hansson To: "Rafael J. Wysocki" , Len Brown , Pavel Machek , Greg Kroah-Hartman , linux-pm@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-acpi@vger.kernel.org, Geert Uytterhoeven , Kevin Hilman , Alan Stern , Daniel Lezcano , Tomasz Figa , devicetree@vger.kernel.org, Linus Walleij , Simon Horman , Magnus Damm , Ben Dooks , Kukjin Kim , Stephen Boyd , Philipp Zabel , Mark Brown , Wolfram Sang , Chris Ball , Russell King , Ulf Hansson , linux-i2c@vger.kernel.org Subject: [PATCH 5/9] i2c: core: Convert to dev_pm_domain_attach|detach() Date: Tue, 26 Aug 2014 14:07:13 +0200 Message-Id: <1409054837-5667-6-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1409054837-5667-1-git-send-email-ulf.hansson@linaro.org> References: <1409054837-5667-1-git-send-email-ulf.hansson@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ulf.hansson@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.220.176 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Previously only the ACPI power domain was supported by the i2c bus. Let's convert to the common attach/detach functions for power domains, which currently means we are extending the support to include the generic power domain as well. Cc: linux-i2c@vger.kernel.org Signed-off-by: Ulf Hansson --- drivers/i2c/i2c-core.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index 66aa83b..7cf7b47 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c @@ -279,10 +279,13 @@ static int i2c_device_probe(struct device *dev) if (status < 0) return status; - acpi_dev_pm_attach(&client->dev, true); - status = driver->probe(client, i2c_match_id(driver->id_table, client)); - if (status) - acpi_dev_pm_detach(&client->dev, true); + status = dev_pm_domain_attach(&client->dev, true); + if (status != -EPROBE_DEFER) { + status = driver->probe(client, i2c_match_id(driver->id_table, + client)); + if (status) + dev_pm_domain_detach(&client->dev, true); + } return status; } @@ -302,7 +305,7 @@ static int i2c_device_remove(struct device *dev) status = driver->remove(client); } - acpi_dev_pm_detach(&client->dev, true); + dev_pm_domain_detach(&client->dev, true); return status; }