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: 4845841 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E3FD29F50F for ; Thu, 4 Sep 2014 13:53:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 47680202E6 for ; Thu, 4 Sep 2014 13:53:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A7DBE20295 for ; Thu, 4 Sep 2014 13:53:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753112AbaIDNxE (ORCPT ); Thu, 4 Sep 2014 09:53:04 -0400 Received: from mail-lb0-f177.google.com ([209.85.217.177]:60918 "EHLO mail-lb0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751102AbaIDNxB (ORCPT ); Thu, 4 Sep 2014 09:53:01 -0400 Received: by mail-lb0-f177.google.com with SMTP id z11so11340738lbi.8 for ; Thu, 04 Sep 2014 06:52:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=tQbMruLBXRzCVt9/djuD77JSsaEN6Yc9v7UMlH7ohO0=; b=evBMLbLT6tWp42j77z0gfx7jqTgtfNJopkHQVUh4M0X2U7p3yGVGDBk/ZFp4+Tc3JI ++NBK+w0MQkX8w5aHa7EPQn9Yde3MiKOkSXbLYi+PUYP1Rrf/8e5zAedlYugkElMFjXx 6Lw1ubY+wzPHFeTNAOYZqwARiEf28+utzVOsXZWev2KErQNCGaT/bnGs+hXWNxn3JEMx +d0I/pXTeOoJ7LGBGNkmXBH0fvqCQL0JO3oVZSWo00546a19K0VzsaDJ1ZxTEGSeL7Jh 59HNM//lH57YWb+Us99seRHamIG6Uah8zk4hrWccX7IwEuEfVBNp7PFWD4Re5FyUO9bW DAAw== X-Gm-Message-State: ALoCoQleeKeodRf0mMTxcUT9tpdlKjwwYzkwdyFF/Wqn6bQzoLRmP4I/wYAO57W1+J1s7e3BFUFK 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> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-8.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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; }