Skip to content

Commit

Permalink
Remove the now unneeded virtio_init
Browse files Browse the repository at this point in the history
Just call virtio_register_ints before accessging the device-specific registers
  • Loading branch information
xl0 committed Aug 22, 2011
1 parent 1d2fd2d commit 942fe53
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 17 deletions.
6 changes: 0 additions & 6 deletions virtio/virtio.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,6 @@
#define NDEVNAMES (sizeof (virtio_device_name) / sizeof (char *))
#define MINSEG_INDIRECT 2 /* use indirect if nsegs >= this value */

void
virtio_init(struct virtio_softc *sc)
{
sc->sc_config_offset = VIRTIO_CONFIG_DEVICE_CONFIG_NOMSI;
}

void
virtio_set_status(struct virtio_softc *sc, int status)
{
Expand Down
1 change: 0 additions & 1 deletion virtio/virtiovar.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ struct virtio_int_handler {

/* public interface */

void virtio_init(struct virtio_softc *sc);
uint32_t virtio_negotiate_features(struct virtio_softc *, uint32_t);
size_t virtio_show_features(uint32_t features, char *buffer, size_t len);
boolean_t virtio_has_feature(struct virtio_softc *sc, uint32_t feature);
Expand Down
13 changes: 5 additions & 8 deletions virtio_blk/vioblk.c
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,6 @@ vioblk_attach(dev_info_t *devinfo, ddi_attach_cmd_t cmd)
ddi_set_driver_private(devinfo, sc);

vsc = &sc->sc_virtio;
virtio_init(vsc);

/* Duplicate for faster access / less typing */
sc->sc_dev = devinfo;
Expand Down Expand Up @@ -971,6 +970,11 @@ vioblk_attach(dev_info_t *devinfo, ddi_attach_cmd_t cmd)
virtio_set_status(&sc->sc_virtio, VIRTIO_CONFIG_DEVICE_STATUS_ACK);
virtio_set_status(&sc->sc_virtio, VIRTIO_CONFIG_DEVICE_STATUS_DRIVER);

if (vioblk_register_ints(sc)) {
dev_err(devinfo, CE_WARN, "Unable to add interrupt");
goto exit_int;
}

ret = vioblk_dev_features(sc);
if (ret)
goto exit_features;
Expand Down Expand Up @@ -1057,13 +1061,6 @@ vioblk_attach(dev_info_t *devinfo, ddi_attach_cmd_t cmd)
sc->sc_nblks, sc->sc_blk_size, sc->sc_size_max,
vioblk_bd_dma_attr.dma_attr_sgllen);

/*
* Establish interrupt handler.
*/
if (vioblk_register_ints(sc)) {
dev_err(devinfo, CE_WARN, "Unable to add interrupt");
goto exit_int;
}

sc->sc_vq = virtio_alloc_vq(&sc->sc_virtio, 0, 0,
sc->sc_seg_max, "I/O request");
Expand Down
2 changes: 0 additions & 2 deletions virtio_net/vioif.c
Original file line number Diff line number Diff line change
Expand Up @@ -1298,8 +1298,6 @@ vioif_attach(dev_info_t *devinfo, ddi_attach_cmd_t cmd)

vsc = &sc->sc_virtio;

virtio_init(vsc);

/* Duplicate for faster access / less typing */
sc->sc_dev = devinfo;
vsc->sc_dev = devinfo;
Expand Down

0 comments on commit 942fe53

Please sign in to comment.