pcmcia: allow for four multifunction subdevices (again)
authorDominik Brodowski <linux@dominikbrodowski.net>
Wed, 24 Mar 2010 09:49:14 +0000 (10:49 +0100)
committerDominik Brodowski <linux@dominikbrodowski.net>
Wed, 24 Mar 2010 09:51:31 +0000 (10:51 +0100)
Commit aa584ca4 broke what 6cf5be51 had already fixed: there may
be four multifunction devices, but just two pseudo-multifunction
devices per PCMCIA card.

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
drivers/pcmcia/ds.c

index ad93ebd7b2a2f8d3e5cdd65b07bff388d49e3db2..52d33b2a5bc559afbd7b59338b09ac8e36bd1b3b 100644 (file)
@@ -509,8 +509,12 @@ struct pcmcia_device *pcmcia_device_add(struct pcmcia_socket *s, unsigned int fu
        p_dev->device_no = (s->device_count++);
        mutex_unlock(&s->ops_mutex);
 
-       /* max of 2 devices per card */
-       if (p_dev->device_no >= 2)
+       /* max of 2 PFC devices */
+       if ((p_dev->device_no >= 2) && (function == 0))
+               goto err_free;
+
+       /* max of 4 devices overall */
+       if (p_dev->device_no >= 4)
                goto err_free;
 
        p_dev->socket = s;