From patchwork Thu Aug 28 08:38:58 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 36162 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f72.google.com (mail-yh0-f72.google.com [209.85.213.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 31FDA20551 for ; Thu, 28 Aug 2014 08:39:24 +0000 (UTC) Received: by mail-yh0-f72.google.com with SMTP id f73sf4421482yha.11 for ; Thu, 28 Aug 2014 01:39:24 -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=aUtcRnvq4xD7o/sZ8vA2gLj0ik4Pckwo3T48e71jIYE=; b=U5tkIbmBO5YytQxgS7+O4TzhdAioIWwNKIXSTV2Vq3BKBYjSiAUQs4+uYKUuap4nk7 /1hw3arbxDfyXKjxyiOkC71dhpB9LqAKyJT9QlhrZcfEmw0/9CCC/92mJejbkNAiVTSb Mkmj8EreXuOJC3SGayAswZC++0h6Uk92vMejFGtrTfVm30E/PSkq8zlAxm0I6C2Jk8w8 YFuD3Fxdyz0N8ylDA22XGyHst3JFMgVK9DglHwfr65dXVRU6CaySHEjOu6Vcwot8BG7P Z4+hPi4KqnwvOmwMzCjAzxgov+CMx/jAiD0KB8Plt1D4dT62mf/o2jYfjGWTCJ1GrknD T5yQ== X-Gm-Message-State: ALoCoQmbsmDbhOQO+KEA8m3m0ChPibEOD6ROnwEWcWFF/6QB9gQyAQeOV6rwL4I/8xdzcDA87Fnr X-Received: by 10.236.77.42 with SMTP id c30mr1494897yhe.6.1409215164037; Thu, 28 Aug 2014 01:39:24 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.32.138 with SMTP id h10ls503229qgh.87.gmail; Thu, 28 Aug 2014 01:39:23 -0700 (PDT) X-Received: by 10.220.49.10 with SMTP id t10mr329553vcf.34.1409215163940; Thu, 28 Aug 2014 01:39:23 -0700 (PDT) Received: from mail-vc0-f175.google.com (mail-vc0-f175.google.com [209.85.220.175]) by mx.google.com with ESMTPS id h9si2946712vcr.11.2014.08.28.01.39.23 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 28 Aug 2014 01:39:23 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.175 as permitted sender) client-ip=209.85.220.175; Received: by mail-vc0-f175.google.com with SMTP id lf12so441848vcb.34 for ; Thu, 28 Aug 2014 01:39:23 -0700 (PDT) X-Received: by 10.52.238.227 with SMTP id vn3mr22340vdc.47.1409215163880; Thu, 28 Aug 2014 01:39:23 -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 uj3csp201163vcb; Thu, 28 Aug 2014 01:39:23 -0700 (PDT) X-Received: by 10.112.28.8 with SMTP id x8mr1053841lbg.104.1409215162818; Thu, 28 Aug 2014 01:39:22 -0700 (PDT) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com [209.85.215.53]) by mx.google.com with ESMTPS id l10si4190610lbk.90.2014.08.28.01.39.22 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 28 Aug 2014 01:39:22 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.215.53 as permitted sender) client-ip=209.85.215.53; Received: by mail-la0-f53.google.com with SMTP id s18so509003lam.26 for ; Thu, 28 Aug 2014 01:39:22 -0700 (PDT) X-Received: by 10.112.4.70 with SMTP id i6mr2581124lbi.54.1409215162320; Thu, 28 Aug 2014 01:39:22 -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 t12sm4826676lbp.44.2014.08.28.01.39.20 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 28 Aug 2014 01:39:21 -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 v2 5/9] i2c: core: Convert to dev_pm_domain_attach|detach() Date: Thu, 28 Aug 2014 10:38:58 +0200 Message-Id: <1409215142-8218-6-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1409215142-8218-1-git-send-email-ulf.hansson@linaro.org> References: <1409215142-8218-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.175 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 632057a..3cd8f11 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; }