From patchwork Wed Feb 19 12:01:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 24950 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f197.google.com (mail-lb0-f197.google.com [209.85.217.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E11F92054E for ; Wed, 19 Feb 2014 12:03:57 +0000 (UTC) Received: by mail-lb0-f197.google.com with SMTP id q8sf423755lbi.4 for ; Wed, 19 Feb 2014 04:03:56 -0800 (PST) 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:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=rGksY/peEX1ISxEmevovKioXGAee1StRxiGB4TDM1Gw=; b=FgWxXemgfHF9xkTdMl3quKeCHkSg8cTtdc9MgQb/5zTD1JkVQjU6crtX7OgKE0vE6R LzUv/x6S25uWMqmiyOFGpM04bAGLrVeafHqa1vYitn+MYG4iuIH0AklJ3OnD+TCEP+ek we3Qc3DJGXcVTdPOHr/iyeC1wzS/TAvpqwnKTFHtpz7NtNmlCQJw3tyTQEM4kaBA6lfc nDGeflYd99wqF74d4DD+uXmCncXQSo+rjmpTBdDHbBgBjyVZr0+NPGfmIB9ptqrTP/tW 2UPjnCZqdRzK+ZqXJlgD9oFxQgUhVNdV2ugkS9J9Bqc+TglnuTk3PNY5s+ZwZFUI9a23 fDhg== X-Gm-Message-State: ALoCoQmz9u8XJJDF81VmEr46mmRToXPp+r+fz7SALtt3bdrXSKEvn+wmImVyg6c09TkbdwCI9CwC X-Received: by 10.152.27.202 with SMTP id v10mr19265135lag.7.1392811436504; Wed, 19 Feb 2014 04:03:56 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.103.118 with SMTP id x109ls71063qge.43.gmail; Wed, 19 Feb 2014 04:03:56 -0800 (PST) X-Received: by 10.221.22.71 with SMTP id qv7mr9446784vcb.34.1392811436310; Wed, 19 Feb 2014 04:03:56 -0800 (PST) Received: from mail-ve0-f173.google.com (mail-ve0-f173.google.com [209.85.128.173]) by mx.google.com with ESMTPS id ke3si6674277veb.65.2014.02.19.04.03.56 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Feb 2014 04:03:56 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.173 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.173; Received: by mail-ve0-f173.google.com with SMTP id jw12so263789veb.32 for ; Wed, 19 Feb 2014 04:03:56 -0800 (PST) X-Received: by 10.220.225.71 with SMTP id ir7mr232143vcb.50.1392811436238; Wed, 19 Feb 2014 04:03:56 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.174.196 with SMTP id u4csp291727vcz; Wed, 19 Feb 2014 04:03:55 -0800 (PST) X-Received: by 10.68.244.8 with SMTP id xc8mr1772039pbc.164.1392811435273; Wed, 19 Feb 2014 04:03:55 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r3si21792451pbh.130.2014.02.19.04.03.54; Wed, 19 Feb 2014 04:03:54 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752936AbaBSMDx (ORCPT + 9 others); Wed, 19 Feb 2014 07:03:53 -0500 Received: from mx1.redhat.com ([209.132.183.28]:35033 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751623AbaBSMDw (ORCPT ); Wed, 19 Feb 2014 07:03:52 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s1JC3ItH030773 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 19 Feb 2014 07:03:19 -0500 Received: from shalem.localdomain.com (vpn1-4-52.ams2.redhat.com [10.36.4.52]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id s1JC24jO012728; Wed, 19 Feb 2014 07:03:14 -0500 From: Hans de Goede To: Tejun Heo , Maxime Ripard Cc: Oliver Schinagl , Richard Zhu , Roger Quadros , Lee Jones , linux-ide@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree , linux-sunxi@googlegroups.com, Hans de Goede Subject: [PATCH v6 14/18] ata: ahci_platform: Add 'struct device' argument to ahci_platform_put_resources() Date: Wed, 19 Feb 2014 13:01:56 +0100 Message-Id: <1392811320-3132-15-git-send-email-hdegoede@redhat.com> In-Reply-To: <1392811320-3132-1-git-send-email-hdegoede@redhat.com> References: <1392811320-3132-1-git-send-email-hdegoede@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 Sender: devicetree-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: devicetree@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: hdegoede@redhat.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.173 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Roger Quadros There is no easy way to access 'struct device' from 'struct ahci_host_priv' so add an explicit argument for 'struct device'. We will need it to call Runtime PM APIs. Signed-off-by: Roger Quadros Signed-off-by: Hans de Goede --- drivers/ata/ahci_imx.c | 5 +++-- drivers/ata/ahci_platform.c | 7 ++++--- drivers/ata/ahci_sunxi.c | 2 +- include/linux/ahci_platform.h | 3 ++- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/drivers/ata/ahci_imx.c b/drivers/ata/ahci_imx.c index 7d51ee2..5cdaf0b 100644 --- a/drivers/ata/ahci_imx.c +++ b/drivers/ata/ahci_imx.c @@ -276,16 +276,17 @@ static int imx_ahci_probe(struct platform_device *pdev) disable: imx_sata_disable(hpriv); put_resources: - ahci_platform_put_resources(hpriv); + ahci_platform_put_resources(dev, hpriv); return ret; } static void ahci_imx_host_stop(struct ata_host *host) { + struct device *dev = host->dev; struct ahci_host_priv *hpriv = host->private_data; imx_sata_disable(hpriv); - ahci_platform_put_resources(hpriv); + ahci_platform_put_resources(dev, hpriv); } static int imx_ahci_suspend(struct device *dev) diff --git a/drivers/ata/ahci_platform.c b/drivers/ata/ahci_platform.c index 073931a..f8ef780 100644 --- a/drivers/ata/ahci_platform.c +++ b/drivers/ata/ahci_platform.c @@ -243,7 +243,8 @@ free_clk: } EXPORT_SYMBOL_GPL(ahci_platform_get_resources); -void ahci_platform_put_resources(struct ahci_host_priv *hpriv) +void ahci_platform_put_resources(struct device *dev, + struct ahci_host_priv *hpriv) { int c; @@ -375,7 +376,7 @@ pdata_exit: disable_resources: ahci_platform_disable_resources(hpriv); put_resources: - ahci_platform_put_resources(hpriv); + ahci_platform_put_resources(dev, hpriv); return rc; } @@ -389,7 +390,7 @@ static void ahci_host_stop(struct ata_host *host) pdata->exit(dev); ahci_platform_disable_resources(hpriv); - ahci_platform_put_resources(hpriv); + ahci_platform_put_resources(dev, hpriv); } #ifdef CONFIG_PM_SLEEP diff --git a/drivers/ata/ahci_sunxi.c b/drivers/ata/ahci_sunxi.c index 568a211..219d77f 100644 --- a/drivers/ata/ahci_sunxi.c +++ b/drivers/ata/ahci_sunxi.c @@ -194,7 +194,7 @@ static int ahci_sunxi_probe(struct platform_device *pdev) disable_resources: ahci_platform_disable_resources(hpriv); put_resources: - ahci_platform_put_resources(hpriv); + ahci_platform_put_resources(dev, hpriv); return rc; } diff --git a/include/linux/ahci_platform.h b/include/linux/ahci_platform.h index 7c683c7..719678c 100644 --- a/include/linux/ahci_platform.h +++ b/include/linux/ahci_platform.h @@ -43,7 +43,8 @@ int ahci_platform_enable_resources(struct ahci_host_priv *hpriv); void ahci_platform_disable_resources(struct ahci_host_priv *hpriv); struct ahci_host_priv *ahci_platform_get_resources( struct platform_device *pdev); -void ahci_platform_put_resources(struct ahci_host_priv *hpriv); +void ahci_platform_put_resources(struct device *dev, + struct ahci_host_priv *hpriv); int ahci_platform_init_host(struct platform_device *pdev, struct ahci_host_priv *hpriv, const struct ata_port_info *pi_template,