Remove OLDCARD support by removing compat shims

This commit is contained in:
Warner Losh 2005-09-20 19:54:11 +00:00
parent 973af40a84
commit d39ab32b08
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=150396
4 changed files with 34 additions and 93 deletions

View File

@ -59,7 +59,6 @@ __FBSDID("$FreeBSD$");
static int fe_pccard_probe(device_t);
static int fe_pccard_attach(device_t);
static int fe_pccard_detach(device_t);
static int fe_pccard_match(device_t);
static const struct fe_pccard_product {
struct pccard_product mpp_product;
@ -86,7 +85,7 @@ static const struct fe_pccard_product {
};
static int
fe_pccard_match(device_t dev)
fe_pccard_probe(device_t dev)
{
const struct pccard_product *pp;
int error;
@ -111,15 +110,10 @@ fe_pccard_match(device_t dev)
static device_method_t fe_pccard_methods[] = {
/* Device interface */
DEVMETHOD(device_probe, pccard_compat_probe),
DEVMETHOD(device_attach, pccard_compat_attach),
DEVMETHOD(device_probe, fe_pccard_probe),
DEVMETHOD(device_attach, fe_pccard_attach),
DEVMETHOD(device_detach, fe_pccard_detach),
/* Card interface */
DEVMETHOD(card_compat_match, fe_pccard_match),
DEVMETHOD(card_compat_probe, fe_pccard_probe),
DEVMETHOD(card_compat_attach, fe_pccard_attach),
{ 0, 0 }
};
@ -137,7 +131,7 @@ static int fe_probe_tdk(device_t, const struct fe_pccard_product *);
* Initialize the device - called from Slot manager.
*/
static int
fe_pccard_probe(device_t dev)
fe_pccard_attach(device_t dev)
{
struct fe_softc *sc;
const struct fe_pccard_product *pp;
@ -157,23 +151,16 @@ fe_pccard_probe(device_t dev)
error = fe_probe_mbh(dev, pp);
else
error = fe_probe_tdk(dev, pp);
if (error == 0)
error = fe_alloc_irq(dev, 0);
fe_release_resource(dev);
return (error);
}
static int
fe_pccard_attach(device_t dev)
{
struct fe_softc *sc = device_get_softc(dev);
if (sc->port_used)
fe_alloc_port(dev, sc->port_used);
fe_alloc_irq(dev, 0);
return fe_attach(dev);
if (error != 0) {
fe_release_resource(dev);
return (error);
}
error = fe_alloc_irq(dev, 0);
if (error != 0) {
fe_release_resource(dev);
return (error);
}
return (fe_attach(dev));
}
/*

View File

@ -45,24 +45,17 @@ __FBSDID("$FreeBSD$");
#include "pccarddevs.h"
static int
joy_pccard_match(device_t dev)
joy_pccard_probe(device_t dev)
{
/* For the moment, don't match anything :-) */
return(ENXIO);
}
static device_method_t joy_pccard_methods[] = {
DEVMETHOD(device_probe, pccard_compat_probe),
DEVMETHOD(device_attach, pccard_compat_attach),
DEVMETHOD(device_probe, joy_pccard_probe),
DEVMETHOD(device_attach, joy_attach),
DEVMETHOD(device_detach, joy_detach),
/* Card interface */
DEVMETHOD(card_compat_match, joy_pccard_match),
DEVMETHOD(card_compat_probe, joy_probe),
DEVMETHOD(card_compat_attach, joy_attach),
{ 0, 0 }
{ 0, 0 }
};
static driver_t joy_pccard_driver = {

View File

@ -200,7 +200,8 @@ ncv_alloc_resource(DEVPORT_PDEVICE dev)
return(0);
}
static int ncv_pccard_match(device_t dev)
static int
ncv_pccard_probe(device_t dev)
{
const struct ncv_product *pp;
const char *vendorstr;
@ -228,7 +229,7 @@ static int ncv_pccard_match(device_t dev)
}
static int
ncv_pccard_probe(DEVPORT_PDEVICE dev)
ncv_pccard_attach(device_t dev)
{
struct ncv_softc *sc = device_get_softc(dev);
int error;
@ -244,23 +245,6 @@ ncv_pccard_probe(DEVPORT_PDEVICE dev)
ncv_release_resource(dev);
return(ENXIO);
}
ncv_release_resource(dev);
return(0);
}
static int
ncv_pccard_attach(DEVPORT_PDEVICE dev)
{
struct ncv_softc *sc = device_get_softc(dev);
int error;
error = ncv_alloc_resource(dev);
if (error) {
return(error);
}
error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_CAM | INTR_ENTROPY,
ncv_pccard_intr, (void *)sc, &sc->ncv_intrhand);
if (error) {
@ -277,7 +261,7 @@ ncv_pccard_attach(DEVPORT_PDEVICE dev)
}
static void
ncv_pccard_detach(DEVPORT_PDEVICE dev)
ncv_pccard_detach(device_t dev)
{
ncv_card_unload(dev);
ncv_release_resource(dev);
@ -285,15 +269,10 @@ ncv_pccard_detach(DEVPORT_PDEVICE dev)
static device_method_t ncv_pccard_methods[] = {
/* Device interface */
DEVMETHOD(device_probe, pccard_compat_probe),
DEVMETHOD(device_attach, pccard_compat_attach),
DEVMETHOD(device_probe, ncv_pccard_probe),
DEVMETHOD(device_attach, ncv_pccard_attach),
DEVMETHOD(device_detach, ncv_pccard_detach),
/* Card interface */
DEVMETHOD(card_compat_match, ncv_pccard_match),
DEVMETHOD(card_compat_probe, ncv_pccard_probe),
DEVMETHOD(card_compat_attach, ncv_pccard_attach),
{ 0, 0 }
};

View File

@ -79,7 +79,7 @@ const struct pccard_product nsp_products[] = {
};
/*
* Additional code for FreeBSD new-bus PCCard frontend
* Additional code for FreeBSD new-bus PC Card frontend
*/
static void
@ -89,7 +89,7 @@ nsp_pccard_intr(void * arg)
}
static void
nsp_release_resource(DEVPORT_PDEVICE dev)
nsp_release_resource(device_t dev)
{
struct nsp_softc *sc = device_get_softc(dev);
@ -107,7 +107,7 @@ nsp_release_resource(DEVPORT_PDEVICE dev)
}
static int
nsp_alloc_resource(DEVPORT_PDEVICE dev)
nsp_alloc_resource(device_t dev)
{
struct nsp_softc *sc = device_get_softc(dev);
u_long ioaddr, iosize, maddr, msize;
@ -159,7 +159,8 @@ nsp_alloc_resource(DEVPORT_PDEVICE dev)
return(0);
}
static int nsp_pccard_match(device_t dev)
static int
nsp_pccard_probe(device_t dev)
{
const struct pccard_product *pp;
@ -173,8 +174,9 @@ static int nsp_pccard_match(device_t dev)
}
static int
nsp_pccard_probe(DEVPORT_PDEVICE dev)
nsp_pccard_attach(device_t dev)
{
struct nsp_softc *sc = device_get_softc(dev);
int error;
error = nsp_alloc_resource(dev);
@ -184,20 +186,6 @@ nsp_pccard_probe(DEVPORT_PDEVICE dev)
nsp_release_resource(dev);
return(ENXIO);
}
nsp_release_resource(dev);
return(0);
}
static int
nsp_pccard_attach(DEVPORT_PDEVICE dev)
{
struct nsp_softc *sc = device_get_softc(dev);
int error;
error = nsp_alloc_resource(dev);
if (error)
return(error);
error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_CAM | INTR_ENTROPY,
nsp_pccard_intr, (void *)sc, &sc->nsp_intrhand);
if (error) {
@ -213,7 +201,7 @@ nsp_pccard_attach(DEVPORT_PDEVICE dev)
}
static void
nsp_pccard_detach(DEVPORT_PDEVICE dev)
nsp_pccard_detach(device_t dev)
{
nsp_card_unload(dev);
nsp_release_resource(dev);
@ -221,15 +209,9 @@ nsp_pccard_detach(DEVPORT_PDEVICE dev)
static device_method_t nsp_pccard_methods[] = {
/* Device interface */
DEVMETHOD(device_probe, pccard_compat_probe),
DEVMETHOD(device_attach, pccard_compat_attach),
DEVMETHOD(device_probe, nsp_pccard_probe),
DEVMETHOD(device_attach, nsp_pccard_attach),
DEVMETHOD(device_detach, nsp_pccard_detach),
/* Card interface */
DEVMETHOD(card_compat_match, nsp_pccard_match),
DEVMETHOD(card_compat_probe, nsp_pccard_probe),
DEVMETHOD(card_compat_attach, nsp_pccard_attach),
{ 0, 0 }
};