mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Antony Pavlov <antonynpavlov@gmail.com>
Cc: barebox <barebox@lists.infradead.org>
Subject: Re: serial_ns16550 driver question
Date: Wed, 20 Jul 2011 22:31:56 +0200	[thread overview]
Message-ID: <20110720203156.GT20587@pengutronix.de> (raw)
In-Reply-To: <CAA4bVAGTD7BQxa-wh=i8iiZX33aQOR3g1O5o7_G6XQkYCgShnw@mail.gmail.com>

On Wed, Jul 20, 2011 at 11:51:04PM +0400, Antony Pavlov wrote:
> Hi!
> 
> In include/ns16550.h we have:
> 
> struct NS16550_plat {
>         unsigned int clock;
>         unsigned char f_caps;
>         /**
>          * register read access capability
>          */
>         unsigned int (*reg_read) (unsigned long base, unsigned char reg_offset);
>         /**
>          * register write access capability
>          */
>         void (*reg_write) (unsigned int val, unsigned long base,
>                                     unsigned char reg_offset);
> };
> 
> Why reg_read and reg_write's argument base has type unsigned long?
> IMHO pointer type (void * or char *)  is more natural.

You're right, I also wondered about this recently when looking at a
patch on the list. I would also rather see void __iomem *. The problem
is that this driver is also used on X86 which uses inb/outb which take
an integer argument.
The Linux driver works around this by having a membase and a iobase
field along with different register accessors. While being cleaner
I'm unsure if we want to go this way.

Ssascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2011-07-20 20:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-20 19:51 Antony Pavlov
2011-07-20 20:31 ` Sascha Hauer [this message]
2011-07-21  3:12   ` Jean-Christophe PLAGNIOL-VILLARD
2011-07-21  6:28     ` Sascha Hauer
2011-07-21  8:34       ` Juergen Beisert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110720203156.GT20587@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=antonynpavlov@gmail.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox