pcf.c (d3cf287966fc35bbe511bf6ec24e3396f8feeaa6) pcf.c (f1d19042b082d95f07a0027e596ba2405aa8a9a5)
1/*-
2 * Copyright (c) 1998 Nicolas Souchu, Marc Bouget
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
1/*-
2 * Copyright (c) 1998 Nicolas Souchu, Marc Bouget
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 * $Id: pcf.c,v 1.4 1998/10/31 14:23:09 peter Exp $
26 * $Id: pcf.c,v 1.5 1998/11/04 22:09:17 nsouch Exp $
27 *
28 */
29#include <sys/param.h>
30#include <sys/systm.h>
31#include <sys/kernel.h>
32#include <sys/module.h>
33#include <sys/bus.h>
34#include <sys/conf.h>

--- 109 unchanged lines hidden (view full) ---

144
145#define DEVTOSOFTC(dev) ((struct pcf_softc *)device_get_softc(dev))
146
147static int
148pcfprobe_isa(struct isa_device *dvp)
149{
150 device_t pcfdev;
151 struct pcf_isa_softc *pcf;
27 *
28 */
29#include <sys/param.h>
30#include <sys/systm.h>
31#include <sys/kernel.h>
32#include <sys/module.h>
33#include <sys/bus.h>
34#include <sys/conf.h>

--- 109 unchanged lines hidden (view full) ---

144
145#define DEVTOSOFTC(dev) ((struct pcf_softc *)device_get_softc(dev))
146
147static int
148pcfprobe_isa(struct isa_device *dvp)
149{
150 device_t pcfdev;
151 struct pcf_isa_softc *pcf;
152 int error;
153
154 if (npcf >= MAXPCF)
155 return (0);
156
157 if ((pcf = (struct pcf_isa_softc *)malloc(sizeof(struct pcf_isa_softc),
158 M_DEVBUF, M_NOWAIT)) == NULL)
159 return (0);
160

--- 6 unchanged lines hidden (view full) ---

167 pcfdata[npcf++] = pcf;
168
169 /* XXX add the pcf device to the root_bus until isa bus exists */
170 pcfdev = device_add_child(root_bus, "pcf", pcf->pcf_unit, NULL);
171
172 if (!pcfdev)
173 goto error;
174
152
153 if (npcf >= MAXPCF)
154 return (0);
155
156 if ((pcf = (struct pcf_isa_softc *)malloc(sizeof(struct pcf_isa_softc),
157 M_DEVBUF, M_NOWAIT)) == NULL)
158 return (0);
159

--- 6 unchanged lines hidden (view full) ---

166 pcfdata[npcf++] = pcf;
167
168 /* XXX add the pcf device to the root_bus until isa bus exists */
169 pcfdev = device_add_child(root_bus, "pcf", pcf->pcf_unit, NULL);
170
171 if (!pcfdev)
172 goto error;
173
175end_probe:
176 return (1);
177
178error:
179 free(pcf, M_DEVBUF);
180 return (0);
181}
182
183static int

--- 465 unchanged lines hidden ---
174 return (1);
175
176error:
177 free(pcf, M_DEVBUF);
178 return (0);
179}
180
181static int

--- 465 unchanged lines hidden ---