Skip to contentSkip to conversation

ahci_platform: drop support for a bunch of obsolete platform device types

RFC New Hans de Goede 4 participants 6 messages Feb 22, 2014 1 message not in the archive

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

cover ahci_platform: drop support for a bunch of obsolete platform device types

Hi Tejun, Marek,

This series, which is to be applied on top of my ahci_platform restructering series, mostly speaks for itself.

I've some doubts about the 2nd patch, which removes the imx53-ahci platform device support from ahci_platform.c. I'm pretty sure this is obsolete and replaced by Marek's ahci_imx.c work, but not 100%, which is why this series is marked as RFC. Marek can you confirm that the code the 2nd patch removes is inded dead code?

Tejun, if Marek confirms this is indeed dead code feel free to apply this despite the RFC marking.

Thanks & Regards,

Hans

A message that is not in the archive (sent off-list or not yet received): 1393086175-6383-1-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org

#2 lore raw

RFC 1/3 ahci_platform: Drop support for ahci-strict platform device type

I've done a grep over the entire kernel tree and nothing is using this (anymore?).

---
 drivers/ata/ahci_platform.c | 11 -----------
 1 file changed, 11 deletions(-)
drivers/ata/ahci_platform.c +0 -11
index 75698a4..9fb99cf 100644
@@ -32,7 +32,6 @@ static void ahci_host_stop(struct ata_host *host);
 enum ahci_type {
 	AHCI,		/* standard platform ahci */
 	IMX53_AHCI,	/* ahci on i.mx53 */
-	STRICT_AHCI,	/* delayed DMA engine start */
 };
 
 static struct platform_device_id ahci_devtype[] = {
@@ -43,9 +42,6 @@ static struct platform_device_id ahci_devtype[] = {
 		.name = "imx53-ahci",
 		.driver_data = IMX53_AHCI,
 	}, {
-		.name = "strict-ahci",
-		.driver_data = STRICT_AHCI,
-	}, {
 		/* sentinel */
 	}
 };
@@ -76,13 +72,6 @@ static const struct ata_port_info ahci_port_info[] = {
 		.udma_mask	= ATA_UDMA6,
 		.port_ops	= &ahci_platform_retry_srst_ops,
 	},
-	[STRICT_AHCI] = {
-		AHCI_HFLAGS	(AHCI_HFLAG_DELAY_ENGINE),
-		.flags		= AHCI_FLAG_COMMON,
-		.pio_mask	= ATA_PIO4,
-		.udma_mask	= ATA_UDMA6,
-		.port_ops	= &ahci_platform_ops,
-	},
 };
 
 static struct scsi_host_template ahci_platform_sht = {
Signature · 1 line
1.9.0
#3 lore raw

RFC 2/3 ahci_platform: Drop support for imx53-ahci platform device type

In reply to a message not in the archive

Since the 3.13 release the ahci_imx driver has proper devicetree enabled support for ahci on imx53 and that is used instead of the old board file created imx53-ahci platform device.

Note this patch also complete drops the id-table, an id-table is not needed for a single id platform driver, the name field in the driver struct suffices.

And the code already has an explicit "MODULE_ALIAS("platform:ahci");" so the id-table is not needed for that either.

---
 drivers/ata/ahci_platform.c | 46 ++++++---------------------------------------
 1 file changed, 6 insertions(+), 40 deletions(-)
drivers/ata/ahci_platform.c +6 -40
index 9fb99cf..d48ca8a 100644
@@ -29,49 +29,17 @@
 
 static void ahci_host_stop(struct ata_host *host);
 
-enum ahci_type {
-	AHCI,		/* standard platform ahci */
-	IMX53_AHCI,	/* ahci on i.mx53 */
-};
-
-static struct platform_device_id ahci_devtype[] = {
-	{
-		.name = "ahci",
-		.driver_data = AHCI,
-	}, {
-		.name = "imx53-ahci",
-		.driver_data = IMX53_AHCI,
-	}, {
-		/* sentinel */
-	}
-};
-MODULE_DEVICE_TABLE(platform, ahci_devtype);
-
 struct ata_port_operations ahci_platform_ops = {
 	.inherits	= &ahci_ops,
 	.host_stop	= ahci_host_stop,
 };
 EXPORT_SYMBOL_GPL(ahci_platform_ops);
 
-static struct ata_port_operations ahci_platform_retry_srst_ops = {
-	.inherits	= &ahci_pmp_retry_srst_ops,
-	.host_stop	= ahci_host_stop,
-};
-
-static const struct ata_port_info ahci_port_info[] = {
-	/* by features */
-	[AHCI] = {
-		.flags		= AHCI_FLAG_COMMON,
-		.pio_mask	= ATA_PIO4,
-		.udma_mask	= ATA_UDMA6,
-		.port_ops	= &ahci_platform_ops,
-	},
-	[IMX53_AHCI] = {
-		.flags		= AHCI_FLAG_COMMON,
-		.pio_mask	= ATA_PIO4,
-		.udma_mask	= ATA_UDMA6,
-		.port_ops	= &ahci_platform_retry_srst_ops,
-	},
+static const struct ata_port_info ahci_port_info = {
+	.flags		= AHCI_FLAG_COMMON,
+	.pio_mask	= ATA_PIO4,
+	.udma_mask	= ATA_UDMA6,
+	.port_ops	= &ahci_platform_ops,
 };
 
 static struct scsi_host_template ahci_platform_sht = {
@@ -436,7 +404,6 @@ static int ahci_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
 	struct ahci_platform_data *pdata = dev_get_platdata(dev);
-	const struct platform_device_id *id = platform_get_device_id(pdev);
 	const struct ata_port_info *pi_template;
 	struct ahci_host_priv *hpriv;
 	int rc;
@@ -464,7 +431,7 @@ static int ahci_probe(struct platform_device *pdev)
 	if (pdata && pdata->ata_port_info)
 		pi_template = pdata->ata_port_info;
 	else
-		pi_template = &ahci_port_info[id ? id->driver_data : 0];
+		pi_template = &ahci_port_info;
 
 	rc = ahci_platform_init_host(pdev, hpriv, pi_template,
 				     pdata ? pdata->force_port_map : 0,
@@ -670,7 +637,6 @@ static struct platform_driver ahci_driver = {
 		.of_match_table = ahci_of_match,
 		.pm = &ahci_pm_ops,
 	},
-	.id_table	= ahci_devtype,
 };
 module_platform_driver(ahci_driver);
 
Signature · 1 line
1.9.0
#4 lore raw

RFC 3/3 ahci_platform: Drop unused ahci_platform_data members

In reply to a message not in the archive

These members are not used anywhere, and in the future we want ahci_platform_data to go away entirely so there is no reason to keep these around.

---
 drivers/ata/ahci_platform.c   | 10 +---------
 include/linux/ahci_platform.h |  3 ---
 2 files changed, 1 insertion(+), 12 deletions(-)
drivers/ata/ahci_platform.c +1 -9
index d48ca8a..c04e1a9 100644
@@ -404,7 +404,6 @@ static int ahci_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
 	struct ahci_platform_data *pdata = dev_get_platdata(dev);
-	const struct ata_port_info *pi_template;
 	struct ahci_host_priv *hpriv;
 	int rc;
 
@@ -428,14 +427,7 @@ static int ahci_probe(struct platform_device *pdev)
 			goto disable_resources;
 	}
 
-	if (pdata && pdata->ata_port_info)
-		pi_template = pdata->ata_port_info;
-	else
-		pi_template = &ahci_port_info;
-
-	rc = ahci_platform_init_host(pdev, hpriv, pi_template,
-				     pdata ? pdata->force_port_map : 0,
-				     pdata ? pdata->mask_port_map  : 0);
+	rc = ahci_platform_init_host(pdev, hpriv, &ahci_port_info, 0, 0);
 	if (rc)
 		goto pdata_exit;
 
include/linux/ahci_platform.h +0 -3
index 542f268..1f16d50 100644
@@ -33,9 +33,6 @@ struct ahci_platform_data {
 	void (*exit)(struct device *dev);
 	int (*suspend)(struct device *dev);
 	int (*resume)(struct device *dev);
-	const struct ata_port_info *ata_port_info;
-	unsigned int force_port_map;
-	unsigned int mask_port_map;
 };
 
 int ahci_platform_enable_clks(struct ahci_host_priv *hpriv);
Signature · 1 line
1.9.0
#5 lore raw

cover ahci_platform: drop support for a bunch of obsolete platform device types

In reply to Hans de Goede
Quoted 10 lines · Hans de Goede

Hi Tejun, Marek,

This series, which is to be applied on top of my ahci_platform restructering series, mostly speaks for itself.

I've some doubts about the 2nd patch, which removes the imx53-ahci platform device support from ahci_platform.c. I'm pretty sure this is obsolete and replaced by Marek's ahci_imx.c work, but not 100%, which is why this series is marked as RFC. Marek can you confirm that the code the 2nd patch removes is inded dead code?

I can confirm that with your sunxi 15-patch patchset + these three patches , the SATA port still works on i.MX53 DENX M53EVK board. The behavior from the user's point of view is unchanged.

Quoted 6 lines

Tejun, if Marek confirms this is indeed dead code feel free to apply this despite the RFC marking.

Thanks & Regards,

Hans

Best regards,
Marek Vasut

#6 lore raw

cover ahci_platform: drop support for a bunch of obsolete platform device types

In reply to Hans de Goede
Quoted 5 lines · Hans de Goede

Hi Tejun, Marek,

This series, which is to be applied on top of my ahci_platform restructering series, mostly speaks for itself.

Quoted 8 lines

I've some doubts about the 2nd patch, which removes the imx53-ahci platform device support from ahci_platform.c. I'm pretty sure this is obsolete and replaced by Marek's ahci_imx.c work, but not 100%, which is why this series is marked as RFC. Marek can you confirm that the code the 2nd patch removes is inded dead code?

Tejun, if Marek confirms this is indeed dead code feel free to apply this despite the RFC marking.

Applied 1-3 to libata/for-3.15.

Thanks.

Signature · 1 line
tejun