Module Name: src
Committed By: tsutsui
Date: Sat Sep 5 12:46:55 UTC 2009
Modified Files:
src/sys/dev/ic: aic79xx_osm.c
Log Message:
Use device_private() to get softc.
To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/dev/ic/aic79xx_osm.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/ic/aic79xx_osm.c
diff -u src/sys/dev/ic/aic79xx_osm.c:1.26 src/sys/dev/ic/aic79xx_osm.c:1.27
--- src/sys/dev/ic/aic79xx_osm.c:1.26 Sat Sep 5 12:43:56 2009
+++ src/sys/dev/ic/aic79xx_osm.c Sat Sep 5 12:46:55 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: aic79xx_osm.c,v 1.26 2009/09/05 12:43:56 tsutsui Exp $ */
+/* $NetBSD: aic79xx_osm.c,v 1.27 2009/09/05 12:46:55 tsutsui Exp $ */
/*
* Bus independent NetBSD shim for the aic7xxx based adaptec SCSI controllers
@@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: aic79xx_osm.c,v 1.26 2009/09/05 12:43:56 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: aic79xx_osm.c,v 1.27 2009/09/05 12:46:55 tsutsui Exp $");
#include <dev/ic/aic79xx_osm.h>
#include <dev/ic/aic79xx_inline.h>
@@ -156,9 +156,11 @@
ahd_ioctl(struct scsipi_channel *channel, u_long cmd,
void *addr, int flag, struct proc *p)
{
- struct ahd_softc *ahd = (void *)channel->chan_adapter->adapt_dev;
+ struct ahd_softc *ahd;
int s, ret = ENOTTY;
+ ahd = device_private(channel->chan_adapter->adapt_dev);
+
switch (cmd) {
case SCBUSIORESET:
s = splbio();
@@ -321,7 +323,7 @@
struct ahd_initiator_tinfo *tinfo;
struct ahd_tmode_tstate *tstate;
- ahd = (void *)chan->chan_adapter->adapt_dev;
+ ahd = device_private(chan->chan_adapter->adapt_dev);
switch(req) {
@@ -537,7 +539,8 @@
xs->error = 0;
xs->status = 0;
xs->xs_status = 0;
- ahd = (void*)xs->xs_periph->periph_channel->chan_adapter->adapt_dev;
+ ahd = device_private(
+ xs->xs_periph->periph_channel->chan_adapter->adapt_dev);
scb->sg_count = 0;
if (nsegments != 0) {
@@ -805,7 +808,7 @@
{
int rv = 0;
- struct ahd_softc *ahd = (struct ahd_softc*)self;
+ struct ahd_softc *ahd = device_private(self);
if (ahd->sc_child != NULL)
rv = config_detach(ahd->sc_child, flags);