]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging: gdm72xx: Set up parent link in sysfs for gdm72xx devices
authorPaul Stewart <pstew@chromium.org>
Thu, 17 May 2012 18:15:10 +0000 (11:15 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 May 2012 20:17:41 +0000 (13:17 -0700)
This patch uses SET_NETDEV_DEV to set up a 'device' parent link in sysfs
(e.g. /sys/class/net/wm0/device) for a gdm72xx device.

Signed-off-by: Paul Stewart <pstew@chromium.org>
Signed-off-by: Ben Chan <benchan@chromium.org>
Cc: Sage Ahn <syahn@gctsemi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/gdm72xx/gdm_sdio.c
drivers/staging/gdm72xx/gdm_usb.c
drivers/staging/gdm72xx/gdm_wimax.c
drivers/staging/gdm72xx/gdm_wimax.h

index 1ef466e718ae344743b3dff34c97142d54e3052d..e1a3dd2fc4afeed7bdfc65335bee08fe934554a0 100644 (file)
@@ -618,7 +618,7 @@ end_io:
 done:
        sdio_writeb(func, 0x00, 0x10, &ret);    /* PCRRT */
        if (!phy_dev->netdev)
-               register_wimax_device(phy_dev);
+               register_wimax_device(phy_dev, &func->dev);
 }
 
 static int gdm_sdio_receive(void *priv_dev,
index f60e890c65c836529f4b36b2cbad94a13ccd7c9e..1e9dc0d903620fdbae4f1f2f1e170b8e9c18999e 100644 (file)
@@ -624,7 +624,7 @@ static int gdm_usb_probe(struct usb_interface *intf,
        INIT_WORK(&udev->pm_ws, do_pm_control);
 #endif /* CONFIG_WIMAX_GDM72XX_USB_PM */
 
-       ret = register_wimax_device(phy_dev);
+       ret = register_wimax_device(phy_dev, &intf->dev);
 
 out:
        if (ret) {
index 27874941f75acc159309f83d9330bc46287085c6..f1936b92533b9828f720a9a87b6cfa9187b158e0 100644 (file)
@@ -943,7 +943,7 @@ static struct net_device_ops gdm_netdev_ops = {
        .ndo_do_ioctl                   = gdm_wimax_ioctl,
 };
 
-int register_wimax_device(struct phy_dev *phy_dev)
+int register_wimax_device(struct phy_dev *phy_dev, struct device *pdev)
 {
        struct nic *nic = NULL;
        struct net_device *dev;
@@ -957,6 +957,7 @@ int register_wimax_device(struct phy_dev *phy_dev)
                return -ENOMEM;
        }
 
+       SET_NETDEV_DEV(dev, pdev);
        dev->mtu = 1400;
        dev->netdev_ops = &gdm_netdev_ops;
        dev->flags &= ~IFF_MULTICAST;
index a1cd71ef8e976199a09667dabb5a2cbc01030ff4..023e6492e33d165f2ae31335f479d807a16403f1 100644 (file)
@@ -85,7 +85,7 @@ struct nic {
 
 /*#define LOOPBACK_TEST */
 
-extern int register_wimax_device(struct phy_dev *phy_dev);
+extern int register_wimax_device(struct phy_dev *phy_dev, struct device *pdev);
 extern int gdm_wimax_send_tx(struct sk_buff *skb, struct net_device *dev);
 extern void unregister_wimax_device(struct phy_dev *phy_dev);