All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Patrick Gefre <pfg@sgi.com>
Cc: Christoph Hellwig <hch@infradead.org>,
	linux-kernel@vger.kernel.org, matthew@wil.cx
Subject: Re: [PATCH] 2.6.10 Altix : ioc4 serial driver support
Date: Mon, 3 Jan 2005 14:09:38 +0000	[thread overview]
Message-ID: <20050103140938.GA20070@infradead.org> (raw)
In-Reply-To: <41C9D0B8.9000208@sgi.com>

On Wed, Dec 22, 2004 at 01:53:28PM -0600, Patrick Gefre wrote:
> Christoph Hellwig wrote:
> 
> >So both claim the same PCI ID?  In this case you need to creat a small
> >shim driver that exports a pseudo-bus to the serial and ide driver using
> >the driver model.  You must never return an error from ->probe if you
> >actually use that particular device.
> >
> 
> Has this been done before ? Any example I can use ??

Well, just about any secondary bus (e.g. usb, iee1394, i2c) works that way,
but I guess all those examples are a little too complicated for your example.
the PPC OCP stuff might be a better example as it's an on-chip pseudo-bus,
otoh it's a top-level bus and not parented by PCI.

> >The second argumnet to writeX (and readX) is actually void __iomem *,
> >but to see the difference you need to run sparse (from sparse.bkbits.net)
> >over the driver.  Please store all I/O addresses in void __iomem * pointers
> >in your structures and avoid the cast here and in all the other places.
> >
> 
> So then I'd have to declare the end elements as:
> void __iomem foo;
> 
> They are 32 bit values, so it's OK to assume that void __iomem is 32bits ?

Hmm?  void __iomem must only ever be used as a pointer and passed to
readX/writeX.  Pointer arithmetics are allowed and it's treated equally
to char * for that (GCC extension)

> >no need to cast the return value from kmalloc (dito for the other places)
> >
> 
> Why is that ? Seems if kmalloc returns a void * and the left side is not, a 
> casting is appropriate ?

void * is magic in C and can be assigned to any pointer and vice versa.


  parent reply	other threads:[~2005-01-03 14:10 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-22  0:28 [PATCH] 2.6.10 Altix : ioc4 serial driver support Pat Gefre
2004-12-22 13:44 ` Christoph Hellwig
2004-12-22 14:03   ` Russell King
2004-12-22 15:20     ` Patrick Gefre
2004-12-22 18:49       ` Russell King
2004-12-22 19:53   ` Patrick Gefre
2004-12-22 20:33     ` Matthew Wilcox
2005-01-03 14:09     ` Christoph Hellwig [this message]
2005-01-31 22:45       ` [PATCH] " Pat Gefre
2005-02-01  9:23         ` Christoph Hellwig
2005-02-02 20:36           ` Patrick Gefre
2005-02-02 21:37             ` Bartlomiej Zolnierkiewicz
2005-02-02 21:57             ` Christoph Hellwig
2005-02-07 15:58               ` Patrick Gefre
2005-02-07 16:25                 ` Christoph Hellwig
2005-02-08 16:52                   ` Patrick Gefre
2005-02-08 19:32                     ` Patrick Gefre
2005-02-10 19:09                     ` Jesse Barnes
2005-02-10 19:15                       ` Christoph Hellwig
2005-02-10 21:07                         ` Patrick Gefre
2005-02-17 21:55                           ` Patrick Gefre
  -- strict thread matches above, loose matches on Subject: below --
2004-12-16 22:24 [PATCH] 2.6.10 " Pat Gefre
2004-12-16 22:24 ` Pat Gefre
2004-12-16 22:43 ` Matthew Wilcox
2004-12-16 23:15 ` Christoph Hellwig
2004-12-17 16:24   ` Matthew Wilcox
2004-12-17 22:14   ` Patrick Gefre
2004-12-17 22:14     ` Patrick Gefre
2004-12-18 14:51     ` Christoph Hellwig

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=20050103140938.GA20070@infradead.org \
    --to=hch@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthew@wil.cx \
    --cc=pfg@sgi.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.