[PATCH -mm2] CardServices compatibility layer

Russell King rmk+pcmcia at arm.linux.org.uk
Mon Dec 29 21:10:19 GMT 2003


On Mon, Dec 29, 2003 at 12:10:47PM -0800, Andrew Morton wrote:
> Dominik Brodowski <linux at dominikbrodowski.de> wrote:
> >
> > From -mm2 changelog:
> > > Complete the removal of the usage of the CardServices API from drivers. 
> > > It's a bit late for this, but apparantly the varargs usage in the API
> > > cannot work correctly on x86_64 (at least).
> > 
> > ... as it's so late, let's add a compatibility layer which allows for
> > CardServices usage as long as !x86_64. 
> > 
> 
> That seems like a good idea, but I'll need help from rmk, dhinds, etc on
> understanding whether it is a desirable thing.

There are two solutions to this problem:
 - keep the old CardServices() as is with all its broken quirks
 - use the preprocessor to convert the old API to something better.
   iow:

#define CardServices(x,args...) __pcmcia_##x(args)

#define __pcmcia_RegisterClient pcmcia_register_client

and so forth.  I think the latter is preferable than the former from a
correctness point of view if we have to keep the old calling convention,
even though it means a fairly disgusting set of #defines.

> Note the "(at least)".  I think other architectures have a similar problem
> - I'm not sure what the complete list is.

I seem to remember its also included ppc64, but, while there are ppc64
systems with PCI slots (and therefore have the ability to plug in a
cardbus adapter) BenH said that so far no one's tried.  As I mentioned
above, x86 with -mregparam also gets the old API wrong as well.

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 PCMCIA      - http://pcmcia.arm.linux.org.uk/
                 2.6 Serial core



More information about the linux-pcmcia mailing list