From patchwork Fri Dec 13 09:05:27 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mugunthan V N X-Patchwork-Id: 300940 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id EA4A32C009C for ; Fri, 13 Dec 2013 20:05:45 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752254Ab3LMJFl (ORCPT ); Fri, 13 Dec 2013 04:05:41 -0500 Received: from arroyo.ext.ti.com ([192.94.94.40]:54733 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751182Ab3LMJFh (ORCPT ); Fri, 13 Dec 2013 04:05:37 -0500 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id rBD95VBW000863; Fri, 13 Dec 2013 03:05:32 -0600 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id rBD95VRv029563; Fri, 13 Dec 2013 03:05:31 -0600 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.2.342.3; Fri, 13 Dec 2013 03:05:31 -0600 Received: from mugunthan-lt.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id rBD95Th5007592; Fri, 13 Dec 2013 03:05:30 -0600 From: Mugunthan V N To: CC: , , George Cherian , Mugunthan V N Subject: [net PATCH v2 1/1] drivers: net : cpsw: pass proper device name while requesting irq Date: Fri, 13 Dec 2013 14:35:27 +0530 Message-ID: <1386925527-6706-1-git-send-email-mugunthanvnm@ti.com> X-Mailer: git-send-email 1.8.5.1.93.g077f434 MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: George Cherian During checking the interrupts with "cat /proc/interrupts", it is showing device name as (null), this change was done with commit id aa1a15e2d where request_irq is changed to devm_request_irq also changing the irq name from platform device name to net device name, but the net device is not registered at this point with the network frame work, so devm_request_irq is called with device name as NULL, by which it is showed as "(null)" in "cat /proc/interrupts". So this patch moved the devm_request_irq after the net device register so that the device name shows as eth*. Previous to this patch root@am335x-evm:~# cat /proc/interrupts CPU0 28: 2265 INTC 12 edma 30: 80 INTC 14 edma_error 44: 345 INTC 28 mmc1 56: 0 INTC 40 (null) 57: 1794 INTC 41 (null) 58: 7 INTC 42 (null) 59: 0 INTC 43 (null) With this patch root@am335x-evm:~# cat /proc/interrupts CPU0 28: 2254 INTC 12 edma 30: 69 INTC 14 edma_error 44: 324 INTC 28 mmc1 56: 0 INTC 40 eth0 57: 271 INTC 41 eth0 58: 7 INTC 42 eth0 59: 0 INTC 43 eth0 Signed-off-by: George Cherian Signed-off-by: Mugunthan V N --- Changes from Initial version * Changed the commit message to hold more details of the commit changes --- drivers/net/ethernet/ti/cpsw.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c index 5120d9c..d80dfce 100644 --- a/drivers/net/ethernet/ti/cpsw.c +++ b/drivers/net/ethernet/ti/cpsw.c @@ -2103,19 +2103,6 @@ static int cpsw_probe(struct platform_device *pdev) goto clean_ale_ret; } - while ((res = platform_get_resource(priv->pdev, IORESOURCE_IRQ, k))) { - for (i = res->start; i <= res->end; i++) { - if (devm_request_irq(&pdev->dev, i, cpsw_interrupt, 0, - dev_name(priv->dev), priv)) { - dev_err(priv->dev, "error attaching irq\n"); - goto clean_ale_ret; - } - priv->irqs_table[k] = i; - priv->num_irqs = k + 1; - } - k++; - } - ndev->features |= NETIF_F_HW_VLAN_CTAG_FILTER; ndev->netdev_ops = &cpsw_netdev_ops; @@ -2131,6 +2118,19 @@ static int cpsw_probe(struct platform_device *pdev) goto clean_ale_ret; } + while ((res = platform_get_resource(priv->pdev, IORESOURCE_IRQ, k))) { + for (i = res->start; i <= res->end; i++) { + if (devm_request_irq(&pdev->dev, i, cpsw_interrupt, 0, + dev_name(priv->dev), priv)) { + dev_err(priv->dev, "error attaching irq\n"); + goto clean_ale_ret; + } + priv->irqs_table[k] = i; + priv->num_irqs = k + 1; + } + k++; + } + if (cpts_register(&pdev->dev, priv->cpts, data->cpts_clock_mult, data->cpts_clock_shift)) dev_err(priv->dev, "error registering cpts device\n");