fix error checking in ofdisk_open().
remove all vesitages of dk_establish().
This commit is contained in:
parent
128b037bfc
commit
658ce04ab1
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ofdisk.c,v 1.19 2002/09/06 13:18:43 gehenna Exp $ */
|
||||
/* $NetBSD: ofdisk.c,v 1.20 2002/09/18 01:46:40 chs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
|
||||
@ -32,7 +32,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: ofdisk.c,v 1.19 2002/09/06 13:18:43 gehenna Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: ofdisk.c,v 1.20 2002/09/18 01:46:40 chs Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/buf.h>
|
||||
@ -137,9 +137,6 @@ ofdisk_attach(struct device *parent, struct device *self, void *aux)
|
||||
of->sc_dk.dk_name = of->sc_name;
|
||||
strcpy(of->sc_name, of->sc_dev.dv_xname);
|
||||
disk_attach(&of->sc_dk);
|
||||
#ifdef __BROKEN_DK_ESTABLISH
|
||||
dk_establish(&of->sc_dk, self); /* XXX */
|
||||
#endif
|
||||
printf("\n");
|
||||
|
||||
if (strcmp(child, "floppy") == 0)
|
||||
@ -181,7 +178,7 @@ ofdisk_open(dev_t dev, int flags, int fmt, struct proc *p)
|
||||
|
||||
strcat(path, ":0");
|
||||
|
||||
if (!(of->sc_ihandle = OF_open(path)))
|
||||
if ((of->sc_ihandle = OF_open(path)) == -1)
|
||||
return ENXIO;
|
||||
|
||||
/*
|
||||
@ -433,7 +430,7 @@ ofdisk_getdefaultlabel(struct ofdisk_softc *of, struct disklabel *lp)
|
||||
|
||||
/*
|
||||
* XXX Firmware bug? Asking for block size gives a
|
||||
* XXX rediculous number! So we use what the boot program
|
||||
* XXX ridiculous number! So we use what the boot program
|
||||
* XXX uses.
|
||||
*/
|
||||
lp->d_secsize = DEV_BSIZE;
|
||||
|
Loading…
Reference in New Issue
Block a user