2010-05-21 16:45:25     bfin-uart probe function: is there a bug?

Document created by Aaronwu Employee on Aug 21, 2013
Version 1Show Document
  • View in full screen mode

2010-05-21 16:45:25     bfin-uart probe function: is there a bug?

Jeremie RAFIN (FRANCE)

Message: 89647   

 

Ladies and Gentlemen,

 

 

 

In function bfin_serial_probe (from drivers/serial/bfin_5xx.c), I can read this:

 

static int bfin_serial_probe(struct platform_device *dev)

{

    struct resource *res = dev->resource;

    int i;

 

    for (i = 0; i < dev->num_resources; i++, res++)

        if (res->flags & IORESOURCE_MEM)

            break;

 

    if (i < dev->num_resources) {

        for (i = 0; i < nr_active_ports; i++, res++) {

            if (bfin_serial_ports[i].port.mapbase != res->start)

                continue;

            bfin_serial_ports[i].port.dev = &dev->dev;

            uart_add_one_port(&bfin_serial_reg, &bfin_serial_ports[i].port);

        }

    }

 

    return 0;

}

 

 

I am a little bit surprised by the "res++" that I put in red above: if my understanding is correct, this shouldn't be there (so that the "bfin_serial_ports[i]" mapbase is compared to the same ressource "res"). Can you confirm?

 

Note: I am using the 2009R1 release.

 

 

 

Thanks,

 

Jérémie

QuoteReplyEditDelete

 

 

2010-05-24 04:38:28     Re: bfin-uart probe function: is there a bug?

Sonic Zhang (CHINA)

Message: 89798   

 

No, this is not a bug. The UART port resources are sequent elements defined in blackfin board file. They are mapped to fixed element in bfin_serial_ports data array. For example, resource N is mapped to uart0, while resource N+1 to uart1.

QuoteReplyEditDelete

 

 

2010-05-24 17:12:34     Re: bfin-uart probe function: is there a bug?

Mike Frysinger (UNITED STATES)

Message: 89809   

 

that shouldnt be a hard requirement.  if someone only wants UART1, they should be able to define an array of length 1 and set its id to 1 and have it just work.

QuoteReplyEditDelete

 

 

2010-05-25 00:14:19     Re: bfin-uart probe function: is there a bug?

Sonic Zhang (CHINA)

Message: 89814   

 

Don't bother to deal with it, since the array has already be out of date in SVN trunk.

QuoteReplyEditDelete

 

 

2010-05-25 05:28:50     Re: bfin-uart probe function: is there a bug?

Jeremie RAFIN (FRANCE)

Message: 89830   

 

After having had a look to SVN trunk, it looks like the bug does not apply, actually.

 

Thanks!

 

Jérémie

Attachments

    Outcomes