[PATCH -mm2] CardServices compatibility layer
Andrew Morton
akpm at osdl.org
Mon Dec 29 13:26:50 GMT 2003
Russell King <rmk+pcmcia at arm.linux.org.uk> wrote:
>
> 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.
Well there's the third way, which is what Dominik did: implement a real
CardServices() function which has a big switch statement, calls out to the
new API. Seems reasonable, doesn't it?
More information about the linux-pcmcia
mailing list