From 4a331aac448bc6ebd006fa2ea80af68f57c666eb Mon Sep 17 00:00:00 2001 From: christos Date: Wed, 31 Dec 2014 19:52:04 +0000 Subject: make more drivers use disk_ioctl, and add a dev parameter to it so that we can merge the "easy" disklabel ioctls to it. Ultimately all this will go do dk_ioctl once all the drivers have been converted. --- sys/arch/atari/dev/hdfd.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'sys/arch/atari/dev/hdfd.c') diff --git a/sys/arch/atari/dev/hdfd.c b/sys/arch/atari/dev/hdfd.c index 6c2fb17732b..01bdf99d490 100644 --- a/sys/arch/atari/dev/hdfd.c +++ b/sys/arch/atari/dev/hdfd.c @@ -1,4 +1,4 @@ -/* $NetBSD: hdfd.c,v 1.78 2014/07/25 08:10:32 dholland Exp $ */ +/* $NetBSD: hdfd.c,v 1.79 2014/12/31 19:52:04 christos Exp $ */ /*- * Copyright (c) 1996 Leo Weppelman @@ -91,7 +91,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: hdfd.c,v 1.78 2014/07/25 08:10:32 dholland Exp $"); +__KERNEL_RCSID(0, "$NetBSD: hdfd.c,v 1.79 2014/12/31 19:52:04 christos Exp $"); #include "opt_ddb.h" @@ -1304,17 +1304,16 @@ fdioctl(dev_t dev, u_long cmd, void *addr, int flag, struct lwp *l) switch (cmd) { case DIOCGDINFO: - fdgetdisklabel(fd, dev); - *(struct disklabel *)addr = *(fd->sc_dk.dk_label); - return 0; - case DIOCGPART: fdgetdisklabel(fd, dev); - ((struct partinfo *)addr)->disklab = fd->sc_dk.dk_label; - ((struct partinfo *)addr)->part = - &fd->sc_dk.dk_label->d_partitions[RAW_PART]; - return 0; + break; + } + + error = disk_ioctl(&fd->sc_dk, RAW_PART, cmd, addr, flag, l); + if (error != EPASSTHROUGH) + return error; + switch (cmd) { case DIOCWLABEL: if ((flag & FWRITE) == 0) return EBADF; -- cgit