Re: [PATCH 3/4] dmaengine: xlldma platform bus driver

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Grant Likely
Date: Friday, March 26, 2010 - 2:33 pm

On Wed, Mar 17, 2010 at 10:26 AM, Steven J. Magnani
<steve@digidescorp.com> wrote:

Not really worth putting into a separate file.  Just put this hunk in
the xlldma.c file to keep a few more symbols out of the global
namespace.


Superfluous statement.


General convention is to do this the other way around.  No else clause required:

if (!chan->reg_base) {
      /* bail out here */
}
dev_dbg(...)



Don't you need a spinlock protecting the list access?


Be defensive.  Make irq_name at least 20 bytes long in case chan->id
somehow becomes huge.


And if irq # is in the double digits?  This is clever, but unclear and
potentially risky.  Just do another sprintf()


put chan->tx_irq = NO_IRQ before the if(), and you can drop the else
statement (a bit simpler).


Don't bother with all this.  sysfs will tell you whether or not the
driver got registered.  Do this instead:

+static int __init xlldma_plat_init(void)
+{
+       return platform_driver_register(&xlldma_driver);
+}



Put the module_init directly after the xlldma_plat_init() function definition.




-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 3/4] dmaengine: xlldma platform bus driver, Steven J. Magnani, (Wed Mar 17, 9:26 am)
Re: [PATCH 3/4] dmaengine: xlldma platform bus driver, Grant Likely, (Fri Mar 26, 2:33 pm)
Re: [microblaze-uclinux] Re: [PATCH 3/4] dmaengine: xlldma ..., Steven J. Magnani, (Fri Mar 26, 3:20 pm)