Re: [PATCH] Generic platform device IDE driver

From: girish
Date: Wed Oct 04 2006 - 08:26:14 EST



On Oct 5, 2006, at 5:02 AM, Paul Mundt wrote:

On Wed, Oct 04, 2006 at 08:30:36PM +0900, girish wrote:
question: where is linux/ide-platform.h header?

answer: there isn't one, as it's not needed. The reason for using
platform devices is so we get _away_ from this ridiculous static set of
definitions for I/O addresses and IRQs that are sprinkled around a lot
of these drivers.

i wrote wrong file name:

where is linux/platform_device.h file?

as per the patch :


+#include <linux/ide.h>
+#include <linux/platform_device.h>
+
+/*
+ * Users use per-port registration with a simple set of 3 resources
+ * per port:
+ * - I/O Base (IORESOURCE_IO)
+ * - CTL Base (IORESOURCE_IO)
+ * - IRQ (IORESOURCE_IRQ)
+ */
+static int __devinit ide_platform_probe(struct platform_device *dev)
+{
+ struct resource *io_res, *ctl_res;
+ hw_regs_t hw;
+
+ if (unlikely(dev->num_resources != 3)) {
+ dev_err(&dev->dev, "invalid number of resources\n");
+ return -EINVAL;
+ }
+
+ io_res = platform_get_resource(dev, IORESOURCE_IO, 0);
+ if (unlikely(io_res == NULL))
+ return -EINVAL;
+
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/