Deleted Added
full compact
35c35
< * $FreeBSD: head/sys/dev/advansys/advansys.c 56926 2000-02-01 00:43:58Z gibbs $
---
> * $FreeBSD: head/sys/dev/advansys/advansys.c 59082 2000-04-07 11:32:42Z nyan $
58a59,61
> #include <machine/resource.h>
> #include <sys/bus.h>
> #include <sys/rman.h>
76,77d78
< u_long adv_unit;
<
95,96d95
< struct adv_softc *advsoftcs[NADV]; /* XXX Config should handle this */
<
732c731
< adv_alloc(int unit, bus_space_tag_t tag, bus_space_handle_t bsh)
---
> adv_alloc(device_t dev, bus_space_tag_t tag, bus_space_handle_t bsh)
734,739c733
< struct adv_softc *adv;
<
< if (unit >= NADV) {
< printf("adv: unit number (%d) too high\n", unit);
< return NULL;
< }
---
> struct adv_softc *adv = device_get_softc(dev);
744,754d737
< if (advsoftcs[unit]) {
< printf("adv%d: memory already allocated\n", unit);
< return NULL;
< }
<
< adv = malloc(sizeof(struct adv_softc), M_DEVBUF, M_NOWAIT);
< if (!adv) {
< printf("adv%d: cannot malloc!\n", unit);
< return NULL;
< }
< bzero(adv, sizeof(struct adv_softc));
757,758c740,741
< advsoftcs[unit] = adv;
< adv->unit = unit;
---
> adv->dev = dev;
> adv->unit = device_get_unit(dev);
794d776
< free(adv, M_DEVBUF);