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: 37651 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2A4FA20293 for ; Fri, 19 Sep 2014 18:28:16 +0000 (UTC) Received: by mail-la0-f71.google.com with SMTP id q1sf1861646lam.2 for ; Fri, 19 Sep 2014 11:28:14 -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=VZVksnmfYS8le4lynl/OZcvFdwjrmXEuIHQfhMkq9/I=; b=bsohGKNU5YGnrXSalHAwVZ13oS8y7EkT7+4VibmU3G270m2Ot0mSD0Kvg0NbQ2nN+t rR1NmrCZQOogGUsqgr1wtR60CHiKYvOPgVF40DokInVmMKhKMLGq+GVGZ8qDiaS0wDeB +u+ac92yLLWX10PqndY3Nyly75O+9ZjCRQHLEi4SfTLcW5EEEXEWKt/NXAbhd905LQ3l igPdN9Bb7kwiIYWQd/PmwOrn+s3Wn4usSgYLEsA/DUhiEaScDQjgN9tbktOB41MjpCDO DQEwoK7WWb7aEKMZrK2Ns/p6Fg2mYCAiC8qYulE45dq0W4gka8FtPi2DcMXreULjht32 1VIg== X-Gm-Message-State: ALoCoQngB5qzJQlA/WA2YK0f+PWwACn+tMRvUXuiqV4jGtYu/3AHwRrk+1nM7kk9oWoML3kipjzl X-Received: by 10.112.163.104 with SMTP id yh8mr2166727lbb.5.1411151294978; Fri, 19 Sep 2014 11:28:14 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.183.201 with SMTP id eo9ls395284lac.20.gmail; Fri, 19 Sep 2014 11:28:14 -0700 (PDT) X-Received: by 10.112.44.129 with SMTP id e1mr8214561lbm.78.1411151294846; Fri, 19 Sep 2014 11:28:14 -0700 (PDT) Received: from mail-la0-f46.google.com (mail-la0-f46.google.com [209.85.215.46]) by mx.google.com with ESMTPS id mi5si3631197lbc.61.2014.09.19.11.28.14 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 19 Sep 2014 11:28:14 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.46 as permitted sender) client-ip=209.85.215.46; Received: by mail-la0-f46.google.com with SMTP id q1so3056645lam.5 for ; Fri, 19 Sep 2014 11:28:14 -0700 (PDT) X-Received: by 10.152.7.8 with SMTP id f8mr8375306laa.27.1411151294746; Fri, 19 Sep 2014 11:28:14 -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.112.130.169 with SMTP id of9csp989520lbb; Fri, 19 Sep 2014 11:28:14 -0700 (PDT) X-Received: by 10.67.14.69 with SMTP id fe5mr3908021pad.73.1411151289490; Fri, 19 Sep 2014 11:28:09 -0700 (PDT) Received: from mail-pd0-f181.google.com (mail-pd0-f181.google.com [209.85.192.181]) by mx.google.com with ESMTPS id so2si4202615pab.132.2014.09.19.11.28.08 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 19 Sep 2014 11:28:09 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.192.181 as permitted sender) client-ip=209.85.192.181; Received: by mail-pd0-f181.google.com with SMTP id r10so420605pdi.26 for ; Fri, 19 Sep 2014 11:28:08 -0700 (PDT) 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> 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.215.46 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 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; }