Re: [RFC][DOC] writing IDE driver guidelines
From: Bartlomiej Zolnierkiewicz <hidden>
Date: 2004-05-15 17:56:24
Also in:
lkml
On Saturday 15 of May 2004 19:34, Jeff Garzik wrote:
On Sat, May 15, 2004 at 07:23:50PM +0200, Bartlomiej Zolnierkiewicz wrote:quoted
- do not believe in popular myth that driver code can be of less quality than core kernel codechuckle :)
hehe :)
quoted
- don't copy without thinking ugly and bogus code (there is still lot of such in IDE)Agreed, but I think most driver authors will not know what is ugly and bogus code, otherwise they would probably not copy it... (I hope!)
Some just copy _everything_ what is in other driver, really...
quoted
- host drivers should request/release IO resource themelves and set hwif->mmio to 2Don't you mean, hwif->mmio==2 for MMIO hardware?
It is was historically for MMIO, now it means that driver handles IO resource itself (per comment in <linux/ide.h>).
quoted
- ide_init_hwif_ports() is obsolete and dying, define IDE_ARCH_NO_OBSOLETE_INIT in <asm/ide.h>hmmmm. Please consider reversing this: Make ide_init_hwif_ports() present _only_ if IDE_ARCH_OBSOLETE_INIT is defined. Then add that define for all arches that still use ide_init_hwif_ports().
Well, I started with this idea but it requires adding this define for far too many archs. This is a problem especially for arm because we have to either leave <asm-arm/arch-*/ide.h> or add #ifdef horror <asm-arm/ide.h>.
quoted
- define ide_default_irq(), ide_init_default_irq() and ide_default_io_base() to (0)Maybe provide generic definitions, so that new arches don't even have to care about this?
Please explain. Thanks, Bartlomiej