aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/virtio/virtio.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/virtio/virtio.c')
-rw-r--r--drivers/virtio/virtio.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/virtio/virtio.c b/drivers/virtio/virtio.c
index 1346ae8e14f3..1c01ac3fad08 100644
--- a/drivers/virtio/virtio.c
+++ b/drivers/virtio/virtio.c
@@ -73,7 +73,7 @@ static int virtio_dev_match(struct device *_dv, struct device_driver *_dr)
73 struct virtio_device *dev = dev_to_virtio(_dv); 73 struct virtio_device *dev = dev_to_virtio(_dv);
74 const struct virtio_device_id *ids; 74 const struct virtio_device_id *ids;
75 75
76 ids = container_of(_dr, struct virtio_driver, driver)->id_table; 76 ids = drv_to_virtio(_dr)->id_table;
77 for (i = 0; ids[i].device; i++) 77 for (i = 0; ids[i].device; i++)
78 if (virtio_id_match(dev, &ids[i])) 78 if (virtio_id_match(dev, &ids[i]))
79 return 1; 79 return 1;
@@ -97,8 +97,7 @@ void virtio_check_driver_offered_feature(const struct virtio_device *vdev,
97 unsigned int fbit) 97 unsigned int fbit)
98{ 98{
99 unsigned int i; 99 unsigned int i;
100 struct virtio_driver *drv = container_of(vdev->dev.driver, 100 struct virtio_driver *drv = drv_to_virtio(vdev->dev.driver);
101 struct virtio_driver, driver);
102 101
103 for (i = 0; i < drv->feature_table_size; i++) 102 for (i = 0; i < drv->feature_table_size; i++)
104 if (drv->feature_table[i] == fbit) 103 if (drv->feature_table[i] == fbit)
@@ -111,8 +110,7 @@ static int virtio_dev_probe(struct device *_d)
111{ 110{
112 int err, i; 111 int err, i;
113 struct virtio_device *dev = dev_to_virtio(_d); 112 struct virtio_device *dev = dev_to_virtio(_d);
114 struct virtio_driver *drv = container_of(dev->dev.driver, 113 struct virtio_driver *drv = drv_to_virtio(dev->dev.driver);
115 struct virtio_driver, driver);
116 u32 device_features; 114 u32 device_features;
117 115
118 /* We have a driver! */ 116 /* We have a driver! */
@@ -152,8 +150,7 @@ static int virtio_dev_probe(struct device *_d)
152static int virtio_dev_remove(struct device *_d) 150static int virtio_dev_remove(struct device *_d)
153{ 151{
154 struct virtio_device *dev = dev_to_virtio(_d); 152 struct virtio_device *dev = dev_to_virtio(_d);
155 struct virtio_driver *drv = container_of(dev->dev.driver, 153 struct virtio_driver *drv = drv_to_virtio(dev->dev.driver);
156 struct virtio_driver, driver);
157 154
158 drv->remove(dev); 155 drv->remove(dev);
159 156