From patchwork Thu Sep 4 13:52:32 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 36711 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f71.google.com (mail-qa0-f71.google.com [209.85.216.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6DAE220CBB for ; Thu, 4 Sep 2014 13:53:06 +0000 (UTC) Received: by mail-qa0-f71.google.com with SMTP id s7sf28582050qap.2 for ; Thu, 04 Sep 2014 06:53:01 -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=tQbMruLBXRzCVt9/djuD77JSsaEN6Yc9v7UMlH7ohO0=; b=VVIYmMbPknqo0kKoSIn+6hVh3gvMB+dD/aXDH61XRUPAJKVs/5RVmSSHOYAFygMCLk 33O4XzPWIngzlFNGeuF/X9sWtsCDP2JVgxBWCtnmkr+moZ3sk53eFHJEU05J+L6Z9PZ7 n3P/RztLdVIQU9neZDA5mLYIJ0Nw1m5U63FKhZ18rkrXMv8rgz23t/5sKL2qi8jRMINw lIG3QiSPKy/5ihhFEzC2/CHShBZ8+ppg/I10S4LblZaxPbIr79Oi7fUfrqVhsHB5FBmK 7sLwOL6tHDoRRwN1hCgoxmNEOE4O6kzgylUZKMfRb4urjyP4iw/5u8zI3hX8WMZolmpd JkQg== X-Gm-Message-State: ALoCoQmaaEWxtpUS6rlrRRMPu6vCXcbitdlqJ7F2Cej3M81b8F/gb4dF47JsyUjQH0MTwTuTdXfh X-Received: by 10.236.159.198 with SMTP id s46mr2403021yhk.17.1409838781804; Thu, 04 Sep 2014 06:53:01 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.107.70 with SMTP id g64ls277804qgf.85.gmail; Thu, 04 Sep 2014 06:53:01 -0700 (PDT) X-Received: by 10.220.114.66 with SMTP id d2mr3884970vcq.27.1409838781729; Thu, 04 Sep 2014 06:53:01 -0700 (PDT) Received: from mail-vc0-f179.google.com (mail-vc0-f179.google.com [209.85.220.179]) by mx.google.com with ESMTPS id h4si2942122vdx.8.2014.09.04.06.53.01 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 04 Sep 2014 06:53:01 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.179 as permitted sender) client-ip=209.85.220.179; Received: by mail-vc0-f179.google.com with SMTP id hy4so10740265vcb.10 for ; Thu, 04 Sep 2014 06:53:01 -0700 (PDT) X-Received: by 10.220.175.17 with SMTP id v17mr4054570vcz.0.1409838781650; Thu, 04 Sep 2014 06:53:01 -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 uj3csp841220vcb; Thu, 4 Sep 2014 06:53:01 -0700 (PDT) X-Received: by 10.112.50.230 with SMTP id f6mr4594695lbo.56.1409838780382; Thu, 04 Sep 2014 06:53:00 -0700 (PDT) Received: from mail-lb0-f179.google.com (mail-lb0-f179.google.com [209.85.217.179]) by mx.google.com with ESMTPS id ml19si2617599lbb.111.2014.09.04.06.52.59 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 04 Sep 2014 06:53:00 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.217.179 as permitted sender) client-ip=209.85.217.179; Received: by mail-lb0-f179.google.com with SMTP id z11so1186693lbi.24 for ; Thu, 04 Sep 2014 06:52:59 -0700 (PDT) X-Received: by 10.112.119.142 with SMTP id ku14mr4564692lbb.34.1409838779915; Thu, 04 Sep 2014 06:52:59 -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 p3sm2085260lap.14.2014.09.04.06.52.56 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 04 Sep 2014 06:52:58 -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 v3 5/9] i2c: core: Convert to dev_pm_domain_attach|detach() Date: Thu, 4 Sep 2014 15:52:32 +0200 Message-Id: <1409838756-31963-6-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1409838756-31963-1-git-send-email-ulf.hansson@linaro.org> References: <1409838756-31963-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.179 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 PM domain was supported by the i2c bus. Let's convert to the common attach/detach functions for PM domains, which currently means we are extending the support to include the generic PM 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; }