Merge git://github.com/rustyrussell/linux

* git://github.com/rustyrussell/linux:
  virtio-blk: use ida to allocate disk index
  virtio: Add platform bus driver for memory mapped virtio device
  virtio: Dont add "config" to list for !per_vq_vector
  virtio: console: wait for first console port for early console output
  virtio: console: add port stats for bytes received, sent and discarded
  virtio: console: make discard_port_data() use get_inbuf()
  virtio: console: rename variable
  virtio: console: make get_inbuf() return port->inbuf if present
  virtio: console: Fix return type for get_inbuf()
  virtio: console: Use wait_event_freezable instead of _interruptible
  virtio: console: Ignore port name update request if name already set
  virtio: console: Fix indentation
  virtio: modify vring_init and vring_size to take account of the layout containing *_event_idx
  virtio.h: correct comment for struct virtio_driver
  virtio-net: Use virtio_config_val() for retrieving config
  virtio_config: Add virtio_config_val_len()
  virtio-console: Use virtio_config_val() for retrieving config
This commit is contained in:
Linus Torvalds 2011-11-02 15:00:56 -07:00
commit 80c2861672
12 changed files with 742 additions and 64 deletions

View file

@ -925,12 +925,10 @@ static void virtnet_update_status(struct virtnet_info *vi)
{
u16 v;
if (!virtio_has_feature(vi->vdev, VIRTIO_NET_F_STATUS))
return;
vi->vdev->config->get(vi->vdev,
if (virtio_config_val(vi->vdev, VIRTIO_NET_F_STATUS,
offsetof(struct virtio_net_config, status),
&v, sizeof(v));
&v) < 0)
return;
/* Ignore unknown (future) status bits */
v &= VIRTIO_NET_S_LINK_UP;
@ -1006,11 +1004,9 @@ static int virtnet_probe(struct virtio_device *vdev)
}
/* Configuration may specify what MAC to use. Otherwise random. */
if (virtio_has_feature(vdev, VIRTIO_NET_F_MAC)) {
vdev->config->get(vdev,
if (virtio_config_val_len(vdev, VIRTIO_NET_F_MAC,
offsetof(struct virtio_net_config, mac),
dev->dev_addr, dev->addr_len);
} else
dev->dev_addr, dev->addr_len) < 0)
random_ether_addr(dev->dev_addr);
/* Set up our device-specific information */