Index: sys/conf/files =================================================================== --- sys/conf/files +++ sys/conf/files @@ -1234,6 +1234,7 @@ dev/cy/cy.c optional cy dev/cy/cy_isa.c optional cy isa dev/cy/cy_pci.c optional cy pci +dev/cyapa/cyapa.c optional cyapa smbus dev/dc/if_dc.c optional dc pci dev/dc/dcphy.c optional dc pci dev/dc/pnphy.c optional dc pci @@ -1459,8 +1460,8 @@ dev/hwpmc/hwpmc_logging.c optional hwpmc dev/hwpmc/hwpmc_mod.c optional hwpmc dev/hwpmc/hwpmc_soft.c optional hwpmc -dev/ichiic/ig4_iic.c optional ichiic -dev/ichiic/ig4_pci.c optional ichiic pci +dev/ichiic/ig4_iic.c optional ig4 smbus +dev/ichiic/ig4_pci.c optional ig4 pci smbus dev/ichsmb/ichsmb.c optional ichsmb dev/ichsmb/ichsmb_pci.c optional ichsmb pci dev/ida/ida.c optional ida @@ -1555,6 +1556,7 @@ dev/iscsi_initiator/isc_sm.c optional iscsi_initiator scbus dev/iscsi_initiator/isc_subr.c optional iscsi_initiator scbus dev/ismt/ismt.c optional ismt +dev/isl/isl.c optional isl smbus dev/isp/isp.c optional isp dev/isp/isp_freebsd.c optional isp dev/isp/isp_library.c optional isp Index: sys/dev/cyapa/cyapa.c =================================================================== --- sys/dev/cyapa/cyapa.c +++ sys/dev/cyapa/cyapa.c @@ -149,7 +149,6 @@ struct cyapa_softc { device_t dev; int count; /* >0 if device opened */ - int unit; int addr; struct cdev *devnode; struct selinfo selinfo; @@ -450,7 +449,6 @@ cyapa_probe(device_t dev) { struct cyapa_cap cap; - int unit; int addr; int error; @@ -463,8 +461,6 @@ if (addr != 0x67) return (ENXIO); - unit = device_get_unit(dev); - error = init_device(dev, &cap, addr, 1); if (error != 0) return (ENXIO); @@ -486,7 +482,7 @@ sc->reporting_mode = 1; unit = device_get_unit(dev); - addr = *((unsigned char*) device_get_ivars(dev)); + addr = smbus_get_addr(dev); if (init_device(dev, &cap, addr, 0)) return (ENXIO); @@ -494,7 +490,6 @@ mtx_init(&sc->mutex, "cyapa", NULL, MTX_DEF); sc->dev = dev; - sc->unit = unit; sc->addr = addr; knlist_init_mtx(&sc->selinfo.si_note, &sc->mutex); Index: sys/dev/ichiic/ig4_iic.c =================================================================== --- sys/dev/ichiic/ig4_iic.c +++ sys/dev/ichiic/ig4_iic.c @@ -74,8 +74,8 @@ static void ig4iic_dump(ig4iic_softc_t *sc); static int ig4_dump; -SYSCTL_INT(_debug, OID_AUTO, ig4_dump, CTLTYPE_INT | CTLFLAG_RW, - &ig4_dump, 0, ""); +SYSCTL_INT(_debug, OID_AUTO, ig4_dump, CTLFLAG_RW, + &ig4_dump, 0, "Dump controller registers"); /* * Low-level inline support functions Index: sys/dev/isl/isl.c =================================================================== --- sys/dev/isl/isl.c +++ sys/dev/isl/isl.c @@ -71,12 +71,9 @@ struct isl_softc { device_t dev; - int unit; int addr; struct sx isl_sx; - struct sysctl_ctx_list *sysctl_ctx; - struct sysctl_oid *sysctl_tree; }; /* Returns < 0 on problem. */ @@ -85,8 +82,7 @@ /* * Initialize the device */ -static -int +static int init_device(device_t dev, int addr, int probe) { static char bl_init[] = { 0x00 }; @@ -145,7 +141,6 @@ static int isl_probe(device_t dev) { - int unit; int addr; int error; @@ -158,8 +153,6 @@ if (addr != 0x44) return (ENXIO); - unit = device_get_unit(dev); - error = init_device(dev, addr, 1); if (error) return (ENXIO); @@ -173,7 +166,8 @@ isl_attach(device_t dev) { struct isl_softc *sc; - int unit; + struct sysctl_ctx_list *sysctl_ctx; + struct sysctl_oid *sysctl_tree; int addr; int use_als; int use_ir; @@ -184,8 +178,7 @@ if (!sc) return (ENOMEM); - unit = device_get_unit(dev); - addr = *((unsigned char*) device_get_ivars(dev)); + addr = smbus_get_addr(dev); if (init_device(dev, addr, 0)) return (ENXIO); @@ -193,48 +186,47 @@ sx_init(&sc->isl_sx, "ISL read lock"); sc->dev = dev; - sc->unit = unit; sc->addr = addr; - sc->sysctl_ctx = device_get_sysctl_ctx(dev); - sc->sysctl_tree = device_get_sysctl_tree(dev); + sysctl_ctx = device_get_sysctl_ctx(dev); + sysctl_tree = device_get_sysctl_tree(dev); use_als = isl_read_sensor(dev, addr, CMD1_MASK_ALS_ONCE) >= 0; use_ir = isl_read_sensor(dev, addr, CMD1_MASK_IR_ONCE) >= 0; use_prox = isl_read_sensor(dev, addr, CMD1_MASK_PROX_ONCE) >= 0; if (use_als) { - SYSCTL_ADD_PROC(sc->sysctl_ctx, - SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, + SYSCTL_ADD_PROC(sysctl_ctx, + SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, "als", CTLTYPE_INT | CTLFLAG_RD, sc, ISL_METHOD_ALS, isl_sysctl, "I", "Current ALS sensor read-out"); } if (use_ir) { - SYSCTL_ADD_PROC(sc->sysctl_ctx, - SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, + SYSCTL_ADD_PROC(sysctl_ctx, + SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, "ir", CTLTYPE_INT | CTLFLAG_RD, sc, ISL_METHOD_IR, isl_sysctl, "I", "Current IR sensor read-out"); } if (use_prox) { - SYSCTL_ADD_PROC(sc->sysctl_ctx, - SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, + SYSCTL_ADD_PROC(sysctl_ctx, + SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, "prox", CTLTYPE_INT | CTLFLAG_RD, sc, ISL_METHOD_PROX, isl_sysctl, "I", "Current proximity sensor read-out"); } - SYSCTL_ADD_PROC(sc->sysctl_ctx, - SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, + SYSCTL_ADD_PROC(sysctl_ctx, + SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, "resolution", CTLTYPE_INT | CTLFLAG_RD, sc, ISL_METHOD_RESOLUTION, isl_sysctl, "I", "Current proximity sensor resolution"); - SYSCTL_ADD_PROC(sc->sysctl_ctx, - SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, + SYSCTL_ADD_PROC(sysctl_ctx, + SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, "range", CTLTYPE_INT | CTLFLAG_RD, sc, ISL_METHOD_RANGE, isl_sysctl, "I", "Current proximity sensor range"); @@ -307,7 +299,8 @@ return (0); } -static int isl_read_sensor(device_t dev, int addr, uint8_t cmd_mask) +static int +isl_read_sensor(device_t dev, int addr, uint8_t cmd_mask) { device_t bus; uint8_t rbyte;