[PATCH v1 2/7] ata: pata_cswarp: bind to the Warp mfd cell instead of the Zorro device
From: Paolo Pisati
Date: Wed Nov 11 2026 - 11:46:26 EST
Now that warp-mfd owns the device and hands the window out as the
"warp-pata" cell, take it from there.
PATA_CSWARP depends on WARP_MFD from here on.
Signed-off-by: Paolo Pisati <p.pisati@xxxxxxxxx>
---
drivers/ata/Kconfig | 2 +-
drivers/ata/pata_cswarp.c | 48 ++++++++++++++-------------------------
2 files changed, 18 insertions(+), 32 deletions(-)
diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index 9704ed688775..407b79bf9405 100644
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -1035,7 +1035,7 @@ config PATA_GAYLE
config PATA_CSWARP
tristate "Amiga CS Warp PATA support"
- depends on M68K && AMIGA && ZORRO
+ depends on WARP_MFD
help
This option enables support for the on-board IDE interface on
CS-Lab Warp Expansion Card (NOTE that idemode=native has to be
diff --git a/drivers/ata/pata_cswarp.c b/drivers/ata/pata_cswarp.c
index 58fe6d0012dc..41b4c93052cf 100644
--- a/drivers/ata/pata_cswarp.c
+++ b/drivers/ata/pata_cswarp.c
@@ -14,14 +14,12 @@
#include <linux/ata.h>
#include <linux/blkdev.h>
#include <linux/delay.h>
-#include <linux/device-id/zorro.h>
#include <linux/interrupt.h>
#include <linux/kernel.h>
#include <linux/libata.h>
#include <linux/mm.h>
#include <linux/module.h>
#include <linux/platform_device.h>
-#include <linux/zorro.h>
#include <scsi/scsi_cmnd.h>
#include <scsi/scsi_host.h>
@@ -32,8 +30,6 @@
#define DRV_NAME "pata_cswarp"
-#define WARP_OFFSET_ATA 0x6000
-
static const struct scsi_host_template pata_cswarp_sht = {
ATA_PIO_SHT(DRV_NAME),
};
@@ -92,33 +88,27 @@ static struct ata_port_operations pata_cswarp_ops = {
.set_mode = pata_cswarp_set_mode,
};
-static int pata_cswarp_probe(struct zorro_dev *z,
- const struct zorro_device_id *ent)
+static int pata_cswarp_probe(struct platform_device *pdev)
{
static const char board_name[] = "csWarp";
struct ata_host *host;
struct ata_port *ap;
struct resource *res;
void __iomem *base;
- unsigned long board = z->resource.start;
- dev_info(&z->dev, "%s IDE controller (board: 0x%lx)\n", board_name,
- board);
+ res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pata");
+ base = devm_ioremap_resource(&pdev->dev, res);
+ if (IS_ERR(base))
+ return PTR_ERR(base);
- res = devm_request_mem_region(&z->dev, board + WARP_OFFSET_ATA, 0x1800,
- DRV_NAME);
- if (!res)
- return -ENXIO;
+ dev_info(&pdev->dev, "%s IDE controller (board: %pR)\n", board_name,
+ res);
- host = ata_host_alloc(&z->dev, 1);
+ host = ata_host_alloc(&pdev->dev, 1);
if (!host)
return -ENXIO;
ap = host->ports[0];
- base = devm_ioremap(&z->dev, board + WARP_OFFSET_ATA, 0x1800);
- if (!base)
- return -ENOMEM;
-
ap->ops = &pata_cswarp_ops;
ap->pio_mask = ATA_PIO4;
@@ -145,34 +135,29 @@ static int pata_cswarp_probe(struct zorro_dev *z,
IRQF_SHARED, &pata_cswarp_sht);
}
-static void pata_cswarp_remove(struct zorro_dev *z)
+static void pata_cswarp_remove(struct platform_device *pdev)
{
- struct ata_host *host = dev_get_drvdata(&z->dev);
+ struct ata_host *host = dev_get_drvdata(&pdev->dev);
ata_host_detach(host);
}
-static const struct zorro_device_id pata_cswarp_zorro_tbl[] = {
- { .id = ZORRO_PROD_CSLAB_WARP_1260 },
- { }
-};
-MODULE_DEVICE_TABLE(zorro, pata_cswarp_zorro_tbl);
-
-static struct zorro_driver pata_cswarp_driver = {
- .name = "pata_cswarp",
- .id_table = pata_cswarp_zorro_tbl,
+static struct platform_driver pata_cswarp_driver = {
+ .driver = {
+ .name = "warp-pata",
+ },
.probe = pata_cswarp_probe,
.remove = pata_cswarp_remove,
};
static int __init pata_cswarp_init(void)
{
- return zorro_register_driver(&pata_cswarp_driver);
+ return platform_driver_register(&pata_cswarp_driver);
}
static void __exit pata_cswarp_unregister(void)
{
- zorro_unregister_driver(&pata_cswarp_driver);
+ platform_driver_unregister(&pata_cswarp_driver);
}
module_init(pata_cswarp_init);
@@ -181,3 +166,4 @@ module_exit(pata_cswarp_unregister);
MODULE_AUTHOR("Andrzej Rogozynski");
MODULE_DESCRIPTION("low-level driver for CSWarp PATA");
MODULE_LICENSE("GPL");
+MODULE_ALIAS("platform:warp-pata");
--
2.43.0