Skip to content
Snippets Groups Projects
Commit 3c0d8c38 authored by Federico Vaga's avatar Federico Vaga
Browse files

vmod:[fix] lun_to_dev() must check all device instances


Problem:
if you declare the first vmod module with LUN=2 (or any number grater than 0)
then the driver will not load the mezzanines.

The real device instance is stored in device_table according to its LUN.
This means that we have to loop over all the table to find the correct
instance. Before the condition was the device instances counter.

Signed-off-by: default avatarFederico Vaga <federico.vaga@cern.ch>
parent 0c98a9fe
No related branches found
No related tags found
No related merge requests found
......@@ -79,7 +79,7 @@ static struct vmodio *lun_to_dev(int lun)
{
int i = 0;
for (i = 0; i < devices; i++) {
for (i = 0; i < MAX_DEVICES; i++) {
struct vmodio *dev = &device_table[i];
if (dev->lun == lun)
return dev;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment