[PATCH 2/2] tty: of_serial: support for 32 bit accesses

Jamie Iles jamie at jamieiles.com
Thu Jun 16 00:49:06 EST 2011


On Wed, Jun 15, 2011 at 07:27:48AM -0600, Grant Likely wrote:
> On Wed, Jun 15, 2011 at 6:49 AM, Jamie Iles <jamie at jamieiles.com> wrote:
[...]
> > diff --git a/drivers/tty/serial/of_serial.c b/drivers/tty/serial/of_serial.c
> > index 4675243..50810a0 100644
> > --- a/drivers/tty/serial/of_serial.c
> > +++ b/drivers/tty/serial/of_serial.c
> > @@ -65,6 +65,23 @@ static int __devinit of_platform_serial_setup(struct platform_device *ofdev,
> >
> >        port->irq = irq_of_parse_and_map(np, 0);
> >        port->iotype = UPIO_MEM;
> > +       prop = of_get_property(np, "io-width", &prop_size);
> > +       if (prop && (prop_size == sizeof(u32))) {
> > +               switch (be32_to_cpup(prop)) {
> > +               case 1:
> > +                       port->iotype = UPIO_MEM;
> > +                       break;
> > +               case 4:
> > +                       port->iotype = UPIO_MEM32;
> > +                       break;
> > +               default:
> > +                       dev_warn(&ofdev->dev,
> > +                                "unsupported io width (%d bytes)\n",
> > +                                be32_to_cpup(prop));
> > +                       return -EINVAL;
> 
> Nit: since this is failing out, it should be dev_err instead of
> dev_warn, but otherwise:
> 
> Acked-by: Grant Likely <grant.likely at secretlab.ca>

OK, thanks.  I'll wait for some comments on the binding documentation 
for the of_serial driver then repost with the change to dev_err().

Thanks,

Jamie


More information about the devicetree-discuss mailing list