Skip to contentSkip to conversation

ata: ahci_sunxi: disable resources on driver removal

PATCH In review Bartlomiej Zolnierkiewicz 1 participant 2 messages Mar 17, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ata: ahci_sunxi: disable resources on driver removal

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

---
Compile tested only.

 drivers/ata/ahci_sunxi.c |   14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
drivers/ata/ahci_sunxi.c +13 -1
Index: b/drivers/ata/ahci_sunxi.c
===================================================================
@@ -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)
#1 lore raw
Quoted 3 lines · Bartlomiej Zolnierkiewicz

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

After looking some more into ahci_platform.c it seems that this patch is not needed, sorry for the noise.

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics