lkml.org 
[lkml]   [2007]   [Mar]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH -mm] Blackfin: blackfin i2c driver
On 3/6/07, Alexey Dobriyan <adobriyan@gmail.com> wrote:
> > +static int __init i2c_bfin_twi_init(void)
> > +{
> > + rc = request_irq(twi_iface.irq, bfin_twi_interrupt_entry, SA_INTERRUPT, "i2c-bfin-twi", &twi_iface);
> > + if (rc) {
> > + printk(KERN_ERR "i2c-bfin-twi: can't get IRQ %d !\n", twi_iface.irq);
> > + return -ENODEV;
> > + }
> > +
> > + /* Set TWI internal clock as 10MHz */
> > + bfin_write_TWI_CONTROL(((get_sclk() / 1024 / 1024 + 5) / 10) & 0x7F);
> > +
> > + /* Set Twi interface clock as specified */
> > + if (CONFIG_TWICLK_KHZ > 400)
> > + bfin_write_TWI_CLKDIV((( 5*1024 / 400 ) << 8) | (( 5*1024 / 400 ) & 0xFF));
> > + else
> > + bfin_write_TWI_CLKDIV((( 5*1024 / CONFIG_TWICLK_KHZ ) << 8) | (( 5*1024 / CONFIG_TWICLK_KHZ ) & 0xFF));
> > +
> > + /* Enable TWI */
> > + bfin_write_TWI_CONTROL(bfin_read_TWI_CONTROL() | TWI_ENA);
> > + SSYNC();
> > +
> > + return i2c_add_adapter(p_adap);
>
> free_irq on error?

what error ? do you mean i2c_add_adapter() ?
-mike
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-03-07 00:07    [W:0.072 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site