From patchwork Fri Sep 19 18:27:39 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 4939421 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id F110FBEEA5 for ; Fri, 19 Sep 2014 18:28:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2C2AF2021A for ; Fri, 19 Sep 2014 18:28:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5E90520211 for ; Fri, 19 Sep 2014 18:28:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757781AbaISS2M (ORCPT ); Fri, 19 Sep 2014 14:28:12 -0400 Received: from mail-pd0-f173.google.com ([209.85.192.173]:36889 "EHLO mail-pd0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757730AbaISS2J (ORCPT ); Fri, 19 Sep 2014 14:28:09 -0400 Received: by mail-pd0-f173.google.com with SMTP id y10so427523pdj.4 for ; Fri, 19 Sep 2014 11:28:08 -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=VZVksnmfYS8le4lynl/OZcvFdwjrmXEuIHQfhMkq9/I=; b=S58z6S9VWfjNMtjebXoGuT82xn4DAkHxDA2Qw6Xvsiv3hOtNWjPqWugBFh/muOIF+A 6Sb19rJaVWrsBP2LfAVtXgq1I89y2WFT8B4zoINLVAC+XnDRLCtJBNjxdg302amWk6yr t4J+AEpi1C0cr+j3PieWWavZmZxveNFxxT3+mZB2+542dhTKJO4ZWgy9nnWaWX9kH/9e SLwGSXtP0V4GtuqvGYFi+wv5uSXpl/ERd6cuTSVYtrwRRp3rxo+fS00P824ejeB5l0KN TIsOYtN4OCKwkN+Bn8+j8PuzAO2NKv1hLAbrVEWiws0qEGQR9IVsNWpyZKOsi6Mu5Vpm kyaw== X-Gm-Message-State: ALoCoQms8eTcgIjuWkgEIzdVJqub+CqF3CbXqDJR/9bmhTF/ScN4yJaTjm0DBOYIDh60sQci8jZ6 X-Received: by 10.68.224.70 with SMTP id ra6mr2814948pbc.33.1411151288802; Fri, 19 Sep 2014 11:28:08 -0700 (PDT) Received: from localhost.localdomain ([38.126.120.10]) by mx.google.com with ESMTPSA id ki1sm2495071pdb.59.2014.09.19.11.28.05 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 19 Sep 2014 11:28:07 -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 , Dmitry Torokhov , Ulf Hansson , linux-i2c@vger.kernel.org Subject: [PATCH v5 06/11] i2c: core: Convert to dev_pm_domain_attach|detach() Date: Fri, 19 Sep 2014 20:27:39 +0200 Message-Id: <1411151264-16245-7-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1411151264-16245-1-git-send-email-ulf.hansson@linaro.org> References: <1411151264-16245-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=-7.6 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 Reviewed-by: Kevin Hilman Acked-by: Wolfram Sang --- 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; }