staging: most: check availability of the callback request_netinfo
authorAndrey Shvetsov <andrey.shvetsov@k2l.de>
Fri, 12 May 2017 10:59:52 +0000 (12:59 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 15 May 2017 09:59:09 +0000 (11:59 +0200)
Since not all HDMs implement the callback request_netinfo, this patch
adds checking of its availability.

Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/most/aim-network/networking.c

index 5822902..03ddbd2 100644 (file)
@@ -203,7 +203,8 @@ static int most_nd_open(struct net_device *dev)
        else
                netif_dormant_on(dev);
        netif_wake_queue(dev);
-       nd->iface->request_netinfo(nd->iface, nd->tx.ch_id);
+       if (nd->iface->request_netinfo)
+               nd->iface->request_netinfo(nd->iface, nd->tx.ch_id);
        return 0;
 }