From mboxrd@z Thu Jan 1 00:00:00 1970 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.0 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable 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 DA448C433E0 for ; Mon, 6 Jul 2020 20:42:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B8EAC20675 for ; Mon, 6 Jul 2020 20:42:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="MIkuIgJM" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726805AbgGFUm1 (ORCPT ); Mon, 6 Jul 2020 16:42:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726280AbgGFUm0 (ORCPT ); Mon, 6 Jul 2020 16:42:26 -0400 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42C9EC061755; Mon, 6 Jul 2020 13:42:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=kjc+i1Ow6AGEI/8UmiAWIVEudBZeCQL7t56EDRRq/Ls=; b=MIkuIgJMIqdETfNCL3n847E40 Wb0ekcn2OLahMEs0hWJb2A2EnVA2Oy4VJHiKAHlhIAXhHvegQcO8eFORTceME+3UQ/OW+NmVDc2+w 11+ONZNOhxs7+LRekH/dOdI2tU7qhMFeqZMXhxAgFlWeXDuI4Ktc4tpMvsIIRkCZFXKGQ8ehHBBo4 5k35Y/0HmpFCREhBPJBfvjXmni6ZSHhcyabewqGqNEYWm4nHi5Ic1RN8OgATan0XchJAORcW0Ik5o R7icLtogIFIedgbLbCNwGQagMm8JS+oVGEkdlS2taTT55W/RrfNuO87m/I2lbwV5OEbfR5EOx/qEJ TLILAkYXw==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:36170) by pandora.armlinux.org.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jsXwW-0006OZ-FJ; Mon, 06 Jul 2020 21:42:24 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1jsXwW-0006E6-7y; Mon, 06 Jul 2020 21:42:24 +0100 Date: Mon, 6 Jul 2020 21:42:24 +0100 From: Russell King - ARM Linux admin To: Chris Healy Cc: Andrew Lunn , Florian Fainelli , Heiner Kallweit , "David S. Miller" , kuba@kernel.org, netdev , linux-kernel Subject: Re: [PATCH] net: sfp: Unique GPIO interrupt names Message-ID: <20200706204224.GW1551@shell.armlinux.org.uk> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Mon, Jul 06, 2020 at 12:38:37PM -0700, Chris Healy wrote: > Dynamically generate a unique GPIO interrupt name, based on the > device name and the GPIO name. For example: > > 103: 0 sx1503q 12 Edge sff2-los > 104: 0 sx1503q 13 Edge sff3-los > > The sffX indicates the SFP the loss of signal GPIO is associated with. > > Signed-off-by: Chris Healy This doesn't work in all cases. > --- > drivers/net/phy/sfp.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/phy/sfp.c b/drivers/net/phy/sfp.c > index 73c2969f11a4..9b03c7229320 100644 > --- a/drivers/net/phy/sfp.c > +++ b/drivers/net/phy/sfp.c > @@ -220,6 +220,7 @@ struct sfp { > struct phy_device *mod_phy; > const struct sff_data *type; > u32 max_power_mW; > + char sfp_irq_name[32]; > > unsigned int (*get_state)(struct sfp *); > void (*set_state)(struct sfp *, unsigned int); > @@ -2349,12 +2350,15 @@ static int sfp_probe(struct platform_device *pdev) > continue; > } > > + snprintf(sfp->sfp_irq_name, sizeof(sfp->sfp_irq_name), > + "%s-%s", dev_name(sfp->dev), gpio_of_names[i]); sfp_irq_name will be overwritten for each GPIO IRQ claimed, which means all IRQs for a particular cage will end up with the same name. sfp_irq_name[] therefore needs to be an array of names, one per input. Thanks. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!