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: 4800371 Return-Path: X-Original-To: patchwork-linux-arm@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 CC8C59F375 for ; Thu, 28 Aug 2014 08:44:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DEA692012E for ; Thu, 28 Aug 2014 08:44:54 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EDA6E200F2 for ; Thu, 28 Aug 2014 08:44:53 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XMvFr-0003fG-Q8; Thu, 28 Aug 2014 08:40:27 +0000 Received: from mail-la0-f51.google.com ([209.85.215.51]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XMvFB-00010Y-MJ for linux-arm-kernel@lists.infradead.org; Thu, 28 Aug 2014 08:39:47 +0000 Received: by mail-la0-f51.google.com with SMTP id gl10so516386lab.10 for ; Thu, 28 Aug 2014 01:39:22 -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=aUtcRnvq4xD7o/sZ8vA2gLj0ik4Pckwo3T48e71jIYE=; b=BDJvqrZGq4uZh7m1zfsHDfes24mYRRKHjUlnzXFeytd2yNKVOmHkLRMIvp/cx9Mxlj mxYWvt9rFjGtO9C69zBDwaFPez5f+Fn/whi+QvvvZW0ABYr9IxUufcR4LiWQq/OTze5L LiwUYbzmmA3waMn3Y4gj+9iWnvNbNQkwhhuuwnhoF0y94r08NLxxhm3HhwhsyltH6eDl MjnptKgMH/RDf4fYomn4cwDhnSYAVyLtvDgdsdXK7qav+y9Y+7wO1UsAzIPI5jj5+pty JGWDvK+EzLdpxbmPgEASi18pXC8NsnZ4CLG8PiaErqDqnZeBrAh/5sSfjS3ENOlNCfR3 vtww== X-Gm-Message-State: ALoCoQkEC+BaZZabgnL1nicLi2ROXdumaMuTDi1GAVjIyZNEMlgcU9lssiaoRnEJ0STaSkqFf4kw 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 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140828_013945_916001_20B7E570 X-CRM114-Status: GOOD ( 13.28 ) X-Spam-Score: -0.7 (/) Cc: devicetree@vger.kernel.org, Ulf Hansson , Kevin Hilman , Russell King , Philipp Zabel , Geert Uytterhoeven , Wolfram Sang , Stephen Boyd , Linus Walleij , Daniel Lezcano , Magnus Damm , Tomasz Figa , Chris Ball , linux-acpi@vger.kernel.org, Simon Horman , Alan Stern , Mark Brown , Ben Dooks , Kukjin Kim , linux-arm-kernel@lists.infradead.org, linux-i2c@vger.kernel.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 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; }