Re: [patch 1/1] ata: Add iMX pata support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello.

On 21-07-2011 19:59, Arnaud Patard (Rtp) wrote:

Add basic support for pata on iMX. It has been tested only on imx51.
SDMA support will probably be added later so this version supports only
PIO.

Signed-off-by: Arnaud Patard<arnaud.patard@xxxxxxxxxxx>
[...]
Index: linux-2.6-submit/drivers/ata/pata_imx.c
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ linux-2.6-submit/drivers/ata/pata_imx.c	2011-07-16 22:35:41.000000000 +0200
@@ -0,0 +1,254 @@
[...]

+static int __devinit pata_imx_probe(struct platform_device *pdev)
+{
+	struct ata_host *host;
+	struct ata_port *ap;
+	struct pata_imx_priv *priv;
+	int irq = 0;
+	struct resource *io_res;
+	struct resource *irq_res;
+
+	io_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	if (io_res == NULL)
+		return -EINVAL;
+
+	irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);

    Why not use platform_get_irq()?

No special reason. Was using get_resource() for mem, so I used it for
irq too.

    platform_get_irq() would yield smaller code.

+	if (irq_res == NULL)
+		return -EINVAL;
+	irq = irq_res->start;
+
+	priv = kzalloc(sizeof(struct pata_imx_priv), GFP_KERNEL);
+	if (!priv)
+		return -ENOMEM;
+
+	priv->clk = clk_get(&pdev->dev, "imx-pata");

    Does iMX support clkdev?

[...]

iirc, it's not supported

   Then it's good idea to pass the clock name thru the platfrom data.

WBR, Sergei
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux