Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id ED70FC43219 for ; Tue, 30 Apr 2019 22:12:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BA99D21743 for ; Tue, 30 Apr 2019 22:12:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="GeaciIYc" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727177AbfD3WMw (ORCPT ); Tue, 30 Apr 2019 18:12:52 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:50601 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726048AbfD3WMw (ORCPT ); Tue, 30 Apr 2019 18:12:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version :Content-Type:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=My7jehS3q31G66MLxVuxb7SE05cYGDtZmhw1/cHMnzU=; b=GeaciIYcS9d8zI6N7y+46jIC4I 2QSujjLnJPequrBQO47+kc9YVtwlt7LTNolBMtfsW++CdnIO/sHnLP/vfYzy6eKS/h4NLSnnmIB0a gRvZ+upy7S/F6ezRcHBWsk00EMRY0XW2bA7kGg2CspARfCPFIgSFInMQ3Vx9cJCXldT4=; Received: from andrew by vps0.lunn.ch with local (Exim 4.89) (envelope-from ) id 1hLaxk-00059C-HN; Wed, 01 May 2019 00:10:56 +0200 From: Andrew Lunn To: David Miller Cc: netdev , Vivien Didelot , Andrew Lunn Subject: [PATCH net-next] net: dsa: mv88e6xxx: Pass interrupt number in platform data Date: Wed, 1 May 2019 00:10:50 +0200 Message-Id: <20190430221050.19749-1-andrew@lunn.ch> X-Mailer: git-send-email 2.11.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Allow an interrupt number to be passed in the platform data. The driver will then use it if not zero, otherwise it will poll for interrupts. Signed-off-by: Andrew Lunn --- drivers/net/dsa/mv88e6xxx/chip.c | 13 +++++++++---- include/linux/platform_data/mv88e6xxx.h | 1 + 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c index 46020fe1b5e7..bad30be699bf 100644 --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c @@ -4894,12 +4894,17 @@ static int mv88e6xxx_probe(struct mdio_device *mdiodev) if (err) goto out; - chip->irq = of_irq_get(np, 0); - if (chip->irq == -EPROBE_DEFER) { - err = chip->irq; - goto out; + if (np) { + chip->irq = of_irq_get(np, 0); + if (chip->irq == -EPROBE_DEFER) { + err = chip->irq; + goto out; + } } + if (pdata) + chip->irq = pdata->irq; + /* Has to be performed before the MDIO bus is created, because * the PHYs will link their interrupts to these interrupt * controllers diff --git a/include/linux/platform_data/mv88e6xxx.h b/include/linux/platform_data/mv88e6xxx.h index 963730b44aea..21452a9365e1 100644 --- a/include/linux/platform_data/mv88e6xxx.h +++ b/include/linux/platform_data/mv88e6xxx.h @@ -13,6 +13,7 @@ struct dsa_mv88e6xxx_pdata { unsigned int enabled_ports; struct net_device *netdev; u32 eeprom_len; + int irq; }; #endif -- 2.20.1