All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
To: Tejun Heo <tj@kernel.org>
Cc: Hans de Goede <hdegoede@redhat.com>,
	Maxime Ripard <maxime.ripard@free-electrons.com>,
	Oliver Schinagl <oliver@schinagl.nl>,
	linux-ide@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH] ata: ahci_sunxi: disable resources on driver removal
Date: Mon, 17 Mar 2014 14:05:15 +0100	[thread overview]
Message-ID: <4639408.hubNkUp5Oa@amdc1032> (raw)

Add custom ->host_stop method to disable resources on driver removal.

Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
---
Compile tested only.

 drivers/ata/ahci_sunxi.c |   14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

Index: b/drivers/ata/ahci_sunxi.c
===================================================================
--- a/drivers/ata/ahci_sunxi.c	2014-03-17 13:48:26.292485389 +0100
+++ b/drivers/ata/ahci_sunxi.c	2014-03-17 13:55:48.912477842 +0100
@@ -156,13 +156,25 @@ static void ahci_sunxi_start_engine(stru
 	sunxi_setbits(port_mmio + PORT_CMD, PORT_CMD_START);
 }
 
+static void ahci_sunxi_host_stop(struct ata_host *host)
+{
+	struct ahci_host_priv *hpriv = host->private_data;
+
+	ahci_platform_disable_resources(hpriv);
+}
+
+static struct ata_port_operations ahci_sunxi_port_ops = {
+	.inherits	= &ahci_platform_ops,
+	.host_stop	= ahci_sunxi_host_stop,
+};
+
 static const struct ata_port_info ahci_sunxi_port_info = {
 	AHCI_HFLAGS(AHCI_HFLAG_32BIT_ONLY | AHCI_HFLAG_NO_MSI |
 			  AHCI_HFLAG_NO_PMP | AHCI_HFLAG_YES_NCQ),
 	.flags		= AHCI_FLAG_COMMON | ATA_FLAG_NCQ,
 	.pio_mask	= ATA_PIO4,
 	.udma_mask	= ATA_UDMA6,
-	.port_ops	= &ahci_platform_ops,
+	.port_ops	= &ahci_sunxi_port_ops,
 };
 
 static int ahci_sunxi_probe(struct platform_device *pdev)

WARNING: multiple messages have this Message-ID (diff)
From: b.zolnierkie@samsung.com (Bartlomiej Zolnierkiewicz)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ata: ahci_sunxi: disable resources on driver removal
Date: Mon, 17 Mar 2014 14:05:15 +0100	[thread overview]
Message-ID: <4639408.hubNkUp5Oa@amdc1032> (raw)

Add custom ->host_stop method to disable resources on driver removal.

Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
---
Compile tested only.

 drivers/ata/ahci_sunxi.c |   14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

Index: b/drivers/ata/ahci_sunxi.c
===================================================================
--- a/drivers/ata/ahci_sunxi.c	2014-03-17 13:48:26.292485389 +0100
+++ b/drivers/ata/ahci_sunxi.c	2014-03-17 13:55:48.912477842 +0100
@@ -156,13 +156,25 @@ static void ahci_sunxi_start_engine(stru
 	sunxi_setbits(port_mmio + PORT_CMD, PORT_CMD_START);
 }
 
+static void ahci_sunxi_host_stop(struct ata_host *host)
+{
+	struct ahci_host_priv *hpriv = host->private_data;
+
+	ahci_platform_disable_resources(hpriv);
+}
+
+static struct ata_port_operations ahci_sunxi_port_ops = {
+	.inherits	= &ahci_platform_ops,
+	.host_stop	= ahci_sunxi_host_stop,
+};
+
 static const struct ata_port_info ahci_sunxi_port_info = {
 	AHCI_HFLAGS(AHCI_HFLAG_32BIT_ONLY | AHCI_HFLAG_NO_MSI |
 			  AHCI_HFLAG_NO_PMP | AHCI_HFLAG_YES_NCQ),
 	.flags		= AHCI_FLAG_COMMON | ATA_FLAG_NCQ,
 	.pio_mask	= ATA_PIO4,
 	.udma_mask	= ATA_UDMA6,
-	.port_ops	= &ahci_platform_ops,
+	.port_ops	= &ahci_sunxi_port_ops,
 };
 
 static int ahci_sunxi_probe(struct platform_device *pdev)

             reply	other threads:[~2014-03-17 13:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-17 13:05 Bartlomiej Zolnierkiewicz [this message]
2014-03-17 13:05 ` [PATCH] ata: ahci_sunxi: disable resources on driver removal Bartlomiej Zolnierkiewicz
2014-03-17 13:16 ` Bartlomiej Zolnierkiewicz
2014-03-17 13:16   ` Bartlomiej Zolnierkiewicz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4639408.hubNkUp5Oa@amdc1032 \
    --to=b.zolnierkie@samsung.com \
    --cc=hdegoede@redhat.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maxime.ripard@free-electrons.com \
    --cc=oliver@schinagl.nl \
    --cc=tj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.