net: hns: use to_platform_device()
authorGeliang Tang <geliangtang@163.com>
Sun, 27 Dec 2015 13:15:44 +0000 (21:15 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 29 Dec 2015 20:32:25 +0000 (15:32 -0500)
Use to_platform_device() instead of open-coding it.

Signed-off-by: Geliang Tang <geliangtang@163.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.c

index 8c30cec8850a8d9f1b605dbfeb376fc7e9b956ef..d2263c72bd8a46673af191c6ad3ce159273c0aae 100644 (file)
@@ -499,8 +499,7 @@ void hns_rcb_get_cfg(struct rcb_common_cb *rcb_common)
        int base_irq_idx = hns_rcb_get_base_irq_idx(rcb_common);
        struct device_node *np = rcb_common->dsaf_dev->dev->of_node;
        struct platform_device *pdev =
-               container_of(rcb_common->dsaf_dev->dev,
-                            struct platform_device, dev);
+               to_platform_device(rcb_common->dsaf_dev->dev);
        bool is_ver1 = AE_IS_VER1(rcb_common->dsaf_dev->dsaf_ver);
 
        for (i = 0; i < ring_num; i++) {