Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754693AbbL0NRx (ORCPT ); Sun, 27 Dec 2015 08:17:53 -0500 Received: from m50-135.163.com ([123.125.50.135]:42616 "EHLO m50-135.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754607AbbL0NRv (ORCPT ); Sun, 27 Dec 2015 08:17:51 -0500 From: Geliang Tang To: "David S. Miller" , Yisen Zhuang , yankejian , huangdaode Cc: Geliang Tang , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 06/10] net: hns: use to_platform_device() Date: Sun, 27 Dec 2015 21:15:44 +0800 Message-Id: <0801535a0c35424d2fd2e91f6ed58058d884e147.1451221174.git.geliangtang@163.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: References: In-Reply-To: References: X-CM-TRANSID: D9GowAAH3qq65H9WPLh9Bw--.6378S3 X-Coremail-Antispam: 1Uf129KBjvdXoW7Gw1xAF48GFW7Jr1DAr45GFg_yoWDWwc_ur W09F1kGF48GFyftF48Kwnxu34Syas0yr97Gr1IyrZrX343JrW3ta4UXr48C3yDWa1IgFnF yFnrKF4Sy3W7tjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IU1OeOtUUUUU== X-Originating-IP: [116.77.145.148] X-CM-SenderInfo: 5jhoxtpqjwt0rj6rljoofrz/xtbByhzdmVO+g0gN9gAAsP Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1189 Lines: 30 Use to_platform_device() instead of open-coding it. Signed-off-by: Geliang Tang --- drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.c b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.c index 8c30cec..d2263c7 100644 --- a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.c +++ b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.c @@ -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++) { -- 2.5.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/