From patchwork Tue Sep 9 11:36:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 37099 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f200.google.com (mail-pd0-f200.google.com [209.85.192.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1F6B320491 for ; Tue, 9 Sep 2014 11:36:58 +0000 (UTC) Received: by mail-pd0-f200.google.com with SMTP id ft15sf25798083pdb.11 for ; Tue, 09 Sep 2014 04:36:57 -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=eK6X2+qjsNfFDmVzl0JdZ5OM3I0zTeOH1IPYCCGJWDGDLMhz7xPr/qcpB4U2GY8jjy 4raSYuyebdRx+fTf1Z46FhE4mUJYu77XfusscKreShzMv4zNtPzxyj8IWZF0DfOqYP5n nY3tzeKEdQ9UVUN32N3Wvw94offRsCM3Cc3xEWcfk7EaD4tOo2DnlObm55goZOJFmflX HZSu/IpxRczN22R8v+p3TuQO5iIXpFPCQeOSDoBLHjnUSDezct3eu9p7f3BbE/XJQ3Md Y60iCelLiRESmkOtm+iPwiRvkpoRARONGRHUKkN5kQt+IG403bwEWTv/rPeg0a4VX7ls uSbA== X-Gm-Message-State: ALoCoQldo3IaxrOy3OInKlERjmKg2KoJW3GugHdaax1nkDZWP/nLkh5Z/SaItr8a6rHXWS0J8rnM X-Received: by 10.70.37.41 with SMTP id v9mr21250655pdj.0.1410262617445; Tue, 09 Sep 2014 04:36:57 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.20.41 with SMTP id 38ls2064895qgi.26.gmail; Tue, 09 Sep 2014 04:36:57 -0700 (PDT) X-Received: by 10.52.61.99 with SMTP id o3mr6222816vdr.46.1410262617312; Tue, 09 Sep 2014 04:36:57 -0700 (PDT) Received: from mail-vc0-f174.google.com (mail-vc0-f174.google.com [209.85.220.174]) by mx.google.com with ESMTPS id as9si5611501vdc.88.2014.09.09.04.36.57 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 09 Sep 2014 04:36:57 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.174 as permitted sender) client-ip=209.85.220.174; Received: by mail-vc0-f174.google.com with SMTP id hy10so2465426vcb.19 for ; Tue, 09 Sep 2014 04:36:57 -0700 (PDT) X-Received: by 10.220.163.69 with SMTP id z5mr30419606vcx.10.1410262617234; Tue, 09 Sep 2014 04:36:57 -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 uj3csp270199vcb; Tue, 9 Sep 2014 04:36:56 -0700 (PDT) X-Received: by 10.112.118.141 with SMTP id km13mr33653154lbb.37.1410262613983; Tue, 09 Sep 2014 04:36:53 -0700 (PDT) Received: from mail-lb0-f180.google.com (mail-lb0-f180.google.com [209.85.217.180]) by mx.google.com with ESMTPS id u6si17390865lbf.137.2014.09.09.04.36.53 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 09 Sep 2014 04:36:53 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.217.180 as permitted sender) client-ip=209.85.217.180; Received: by mail-lb0-f180.google.com with SMTP id b12so1811487lbj.11 for ; Tue, 09 Sep 2014 04:36:53 -0700 (PDT) X-Received: by 10.152.44.136 with SMTP id e8mr14894617lam.36.1410262613470; Tue, 09 Sep 2014 04:36:53 -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 gn7sm4476961lbc.10.2014.09.09.04.36.50 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 09 Sep 2014 04:36:52 -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 v4 5/9] i2c: core: Convert to dev_pm_domain_attach|detach() Date: Tue, 9 Sep 2014 13:36:06 +0200 Message-Id: <1410262570-22785-6-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1410262570-22785-1-git-send-email-ulf.hansson@linaro.org> References: <1409838756-31963-1-git-send-email-ulf.hansson@linaro.org> <1410262570-22785-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.174 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 --- 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; }