From patchwork Wed Jun 5 21:15:27 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 2674261 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 9A1E8DF264 for ; Wed, 5 Jun 2013 21:15:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932395Ab3FEVP3 (ORCPT ); Wed, 5 Jun 2013 17:15:29 -0400 Received: from mail-lb0-f180.google.com ([209.85.217.180]:43974 "EHLO mail-lb0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932577Ab3FEVPY (ORCPT ); Wed, 5 Jun 2013 17:15:24 -0400 Received: by mail-lb0-f180.google.com with SMTP id o10so32349lbi.39 for ; Wed, 05 Jun 2013 14:15:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:organization:to:subject:date:user-agent:cc:references :in-reply-to:mime-version:content-type:content-transfer-encoding :message-id:x-gm-message-state; bh=ArtvzrKdDh4m77/3/rUqyd2cxjMJJqxrHyckE8Eura0=; b=AjemxlnDmzKPfWK41f5skZDsabeSrhtqkTrbRw9WXqLH4JjXGlnZhCHnuIjjrAJDus FSPckJPhfQsvtQcENi7FL+TUp7mOFNFzaeWFYvlvOs5O+L4zPNIfv22tGGzsIuEOuvSW rBPN4ampLT9O3F5QdI4kREAUz7fxgtd6bNOt+R7STI6XmH1hfmwxeU5Et6seJvyFDZC1 ve84f9/Inr8g4WEtMFlyC0mn/LGSJ3ANs9u25tMWHEWoJiB9PdqDGTWnUJbpFs88o0lj ZLBCfdsHh4ZcSGQDG+ve4d2XIQbQ98lLaNOGzLUnKygZUmUYLbGfbGWKpPmeceA+sGxb BFww== X-Received: by 10.112.129.198 with SMTP id ny6mr4496705lbb.113.1370466923208; Wed, 05 Jun 2013 14:15:23 -0700 (PDT) Received: from wasted.dev.rtsoft.ru (ppp91-76-88-205.pppoe.mtu-net.ru. [91.76.88.205]) by mx.google.com with ESMTPSA id t17sm27637994lbd.11.2013.06.05.14.15.21 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 05 Jun 2013 14:15:22 -0700 (PDT) From: Sergei Shtylyov Organization: Cogent Embedded To: netdev@vger.kernel.org Subject: [PATCH v4 5/8] sh_eth: add IRQ flags to 'struct sh_eth_cpu_data' Date: Thu, 6 Jun 2013 01:15:27 +0400 User-Agent: KMail/1.13.5 (Linux/2.6.32.26-175.fc12.i686.PAE; KDE/4.4.5; i686; ; ) Cc: nobuhiro.iwamatsu.yj@renesas.com, linux-sh@vger.kernel.org References: <201306060106.51082.sergei.shtylyov@cogentembedded.com> In-Reply-To: <201306060106.51082.sergei.shtylyov@cogentembedded.com> MIME-Version: 1.0 Message-Id: <201306060115.27643.sergei.shtylyov@cogentembedded.com> X-Gm-Message-State: ALoCoQmV7MpShQ84g8NhT8Wh5ZUQSChRLu6/cWC0OqKcHqIGxNoOVVdoWttCgAQPZJLLM/pdUlpH Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org From: Nobuhiro Iwamatsu The driver supports some SH and SH-Mobile SOCs. There are SOCs with two or more Ethernet devices, for these we need to pass IRQF_SHARED to request_irq(). Add the 'irq_flags' field to the 'struct sh_eth_cpu_data' instead of #ifdef'fery. Signed-off-by: Nobuhiro Iwamatsu [Sergei: properly aligned request_irq() call continuation line, reworded the changelog, reworded the subject, changing the prefix.] Signed-off-by: Sergei Shtylyov --- Changes in version 4: - resolved reject; - properly aligned request_irq() call continuation line; - reworded the changelog; - reworded the subject, changing the prefix. Changes in version 3: - remove 'irq_flags' from 'struct sh_eth_private'; - fix indentation. drivers/net/ethernet/renesas/sh_eth.c | 13 +++++-------- drivers/net/ethernet/renesas/sh_eth.h | 1 + 2 files changed, 6 insertions(+), 8 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: net-next/drivers/net/ethernet/renesas/sh_eth.c =================================================================== --- net-next.orig/drivers/net/ethernet/renesas/sh_eth.c +++ net-next/drivers/net/ethernet/renesas/sh_eth.c @@ -462,6 +462,7 @@ static struct sh_eth_cpu_data sh_eth_my_ EESR_RFRMER | EESR_TFE | EESR_TDE | EESR_ECI, .tx_error_check = EESR_TWB | EESR_TABT | EESR_TDE | EESR_TFE, + .irq_flags = IRQF_SHARED, .apr = 1, .mpr = 1, .tpauser = 1, @@ -570,6 +571,7 @@ static struct sh_eth_cpu_data sh_eth_my_ .fdr_value = 0x0000072f, .rmcr_value = 0x00000001, + .irq_flags = IRQF_SHARED, .apr = 1, .mpr = 1, .tpauser = 1, @@ -650,6 +652,8 @@ static struct sh_eth_cpu_data sh_eth_my_ #if defined(CONFIG_CPU_SUBTYPE_SH7734) .hw_crc = 1, .select_mii = 1, +#else + .irq_flags = IRQF_SHARED, #endif }; @@ -1908,14 +1912,7 @@ static int sh_eth_open(struct net_device pm_runtime_get_sync(&mdp->pdev->dev); ret = request_irq(ndev->irq, sh_eth_interrupt, -#if defined(CONFIG_CPU_SUBTYPE_SH7763) || \ - defined(CONFIG_CPU_SUBTYPE_SH7764) || \ - defined(CONFIG_CPU_SUBTYPE_SH7757) - IRQF_SHARED, -#else - 0, -#endif - ndev->name, ndev); + mdp->cd->irq_flags, ndev->name, ndev); if (ret) { dev_err(&ndev->dev, "Can not assign IRQ number\n"); return ret; Index: net-next/drivers/net/ethernet/renesas/sh_eth.h =================================================================== --- net-next.orig/drivers/net/ethernet/renesas/sh_eth.h +++ net-next/drivers/net/ethernet/renesas/sh_eth.h @@ -463,6 +463,7 @@ struct sh_eth_cpu_data { unsigned long tx_error_check; /* hardware features */ + unsigned long irq_flags; /* IRQ configuration flags */ unsigned no_psr:1; /* EtherC DO NOT have PSR */ unsigned apr:1; /* EtherC have APR */ unsigned mpr:1; /* EtherC have MPR */