summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/mcd/mcd.c14
-rw-r--r--sys/dev/scd/scd.c16
2 files changed, 9 insertions, 21 deletions
diff --git a/sys/dev/mcd/mcd.c b/sys/dev/mcd/mcd.c
index 2ce41bb..5e740ad 100644
--- a/sys/dev/mcd/mcd.c
+++ b/sys/dev/mcd/mcd.c
@@ -134,8 +134,7 @@ static void mcd_soft_reset(struct mcd_softc *);
static int mcd_hard_reset(struct mcd_softc *);
static int mcd_setmode(struct mcd_softc *, int mode);
static int mcd_getqchan(struct mcd_softc *, struct mcd_qchninfo *q);
-static int mcd_subchan(struct mcd_softc *, struct ioc_read_subchannel *sc,
- int nocopyout);
+static int mcd_subchan(struct mcd_softc *, struct ioc_read_subchannel *sc);
static int mcd_toc_header(struct mcd_softc *, struct ioc_toc_header *th);
static int mcd_read_toc(struct mcd_softc *);
static int mcd_toc_entrys(struct mcd_softc *, struct ioc_read_toc_entry *te);
@@ -482,10 +481,8 @@ MCD_TRACE("ioctl called 0x%lx\n", cmd);
case CDIOCPLAYMSF:
r = mcd_playmsf(sc, (struct ioc_play_msf *) addr);
break;
- case CDIOCREADSUBCHANNEL_SYSSPACE:
- return mcd_subchan(sc, (struct ioc_read_subchannel *) addr, 1);
case CDIOCREADSUBCHANNEL:
- return mcd_subchan(sc, (struct ioc_read_subchannel *) addr, 0);
+ return mcd_subchan(sc, (struct ioc_read_subchannel *) addr);
case CDIOREADTOCHEADER:
r = mcd_toc_header(sc, (struct ioc_toc_header *) addr);
break;
@@ -1411,7 +1408,7 @@ mcd_getqchan(struct mcd_softc *sc, struct mcd_qchninfo *q)
}
static int
-mcd_subchan(struct mcd_softc *sc, struct ioc_read_subchannel *sch, int nocopyout)
+mcd_subchan(struct mcd_softc *sc, struct ioc_read_subchannel *sch)
{
struct mcd_qchninfo q;
struct cd_sub_channel_info data;
@@ -1478,10 +1475,7 @@ mcd_subchan(struct mcd_softc *sc, struct ioc_read_subchannel *sch, int nocopyout
}
MCD_UNLOCK(sc);
- if (nocopyout == 0)
- return copyout(&data, sch->data, min(sizeof(struct cd_sub_channel_info), sch->data_len));
- bcopy(&data, sch->data, min(sizeof(struct cd_sub_channel_info), sch->data_len));
- return (0);
+ return (copyout(&data, sch->data, min(sizeof(struct cd_sub_channel_info), sch->data_len)));
}
static int
diff --git a/sys/dev/scd/scd.c b/sys/dev/scd/scd.c
index 1124bff..15be673 100644
--- a/sys/dev/scd/scd.c
+++ b/sys/dev/scd/scd.c
@@ -130,7 +130,7 @@ static int scd_resume(struct scd_softc *);
static int scd_playtracks(struct scd_softc *, struct ioc_play_track *pt);
static int scd_playmsf(struct scd_softc *, struct ioc_play_msf *msf);
static int scd_play(struct scd_softc *, struct ioc_play_msf *msf);
-static int scd_subchan(struct scd_softc *, struct ioc_read_subchannel *sch, int nocopyout);
+static int scd_subchan(struct scd_softc *, struct ioc_read_subchannel *sch);
static int read_subcode(struct scd_softc *, struct sony_subchannel_position_data *sch);
/* for xcdplayer */
@@ -357,10 +357,8 @@ scdioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, struct thread *t
case CDIOCPLAYMSF:
error = scd_playmsf(sc, (struct ioc_play_msf *) addr);
break;
- case CDIOCREADSUBCHANNEL_SYSSPACE:
- return scd_subchan(sc, (struct ioc_read_subchannel *) addr, 1);
case CDIOCREADSUBCHANNEL:
- return scd_subchan(sc, (struct ioc_read_subchannel *) addr, 0);
+ return scd_subchan(sc, (struct ioc_read_subchannel *) addr);
case CDIOREADTOCHEADER:
error = scd_toc_header (sc, (struct ioc_toc_header *) addr);
break;
@@ -564,7 +562,7 @@ scd_eject(struct scd_softc *sc)
}
static int
-scd_subchan(struct scd_softc *sc, struct ioc_read_subchannel *sch, int nocopyout)
+scd_subchan(struct scd_softc *sc, struct ioc_read_subchannel *sch)
{
struct sony_subchannel_position_data q;
struct cd_sub_channel_info data;
@@ -594,12 +592,8 @@ scd_subchan(struct scd_softc *sc, struct ioc_read_subchannel *sch, int nocopyout
data.what.position.absaddr.msf.frame = bcd2bin(q.abs_msf[2]);
SCD_UNLOCK(sc);
- if (nocopyout == 0) {
- if (copyout(&data, sch->data, min(sizeof(struct cd_sub_channel_info), sch->data_len))!=0)
- return (EFAULT);
- } else {
- bcopy(&data, sch->data, min(sizeof(struct cd_sub_channel_info), sch->data_len));
- }
+ if (copyout(&data, sch->data, min(sizeof(struct cd_sub_channel_info), sch->data_len))!=0)
+ return (EFAULT);
return (0);
}
OpenPOWER on IntegriCloud