socket.functions is the number of functions, and so must be one larger
than the maximum function number.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
p_dev->socket = s;
p_dev->device_no = (s->device_count++);
p_dev->func = function;
p_dev->socket = s;
p_dev->device_no = (s->device_count++);
p_dev->func = function;
- if (s->functions < function)
- s->functions = function;
+ if (s->functions <= function)
+ s->functions = function + 1;
p_dev->dev.bus = &pcmcia_bus_type;
p_dev->dev.parent = s->dev.dev;
p_dev->dev.bus = &pcmcia_bus_type;
p_dev->dev.parent = s->dev.dev;