Thread (4 messages) 4 messages, 3 authors, 2015-12-29

Re: [PATCH 06/10] net: hns: use to_platform_device()

From: Geliang Tang <hidden>
Date: 2015-12-27 17:05:51
Also in: lkml

On Sun, Dec 27, 2015 at 03:23:30PM +0200, Andy Shevchenko wrote:
On Sun, Dec 27, 2015 at 3:15 PM, Geliang Tang [off-list ref] wrote:
quoted
Use to_platform_device() instead of open-coding it.

Signed-off-by: Geliang Tang <redacted>
---
 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);
Can it be one line after all? Please, check this for all your patches
of such kind.
Thanks for your review.

It's over 80 characters in one line:

 WARNING: line over 80 characters
 #22: FILE: drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.c:501:
 +	struct platform_device *pdev = to_platform_device(rcb_common->dsaf_dev->dev);

 total: 0 errors, 1 warnings, 0 checks, 10 lines checked

	Geliang
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help