drivers:pcmcia:soc_common: make socket_init and socket_suspend optional
authorJonathan Cameron <jic23@cam.ac.uk>
Wed, 13 Jul 2011 14:54:56 +0000 (15:54 +0100)
committerDominik Brodowski <linux@dominikbrodowski.net>
Fri, 29 Jul 2011 15:55:10 +0000 (17:55 +0200)
10 boards define these empty, probably indicating not everyone has a use for them.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
drivers/pcmcia/soc_common.c

index 768f9572a8c88cca0c91bf8a977060b638ceae6f..a0a9c2aa8d78a5a02aae23065b6e2a51ccec7621 100644 (file)
@@ -186,8 +186,8 @@ static int soc_common_pcmcia_sock_init(struct pcmcia_socket *sock)
        struct soc_pcmcia_socket *skt = to_soc_pcmcia_socket(sock);
 
        debug(skt, 2, "initializing socket\n");
-
-       skt->ops->socket_init(skt);
+       if (skt->ops->socket_init)
+               skt->ops->socket_init(skt);
        return 0;
 }
 
@@ -207,7 +207,8 @@ static int soc_common_pcmcia_suspend(struct pcmcia_socket *sock)
 
        debug(skt, 2, "suspending socket\n");
 
-       skt->ops->socket_suspend(skt);
+       if (skt->ops->socket_suspend)
+               skt->ops->socket_suspend(skt);
 
        return 0;
 }