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=-10.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,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 3AB88C433E0 for ; Sun, 17 May 2020 11:53:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0D53E2075F for ; Sun, 17 May 2020 11:53:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589716428; bh=9FsYMlSfeCJWncuLjQ3mbr2AKny28mgZM1pKTVtJH+0=; h=From:To:Cc:Subject:Date:List-ID:From; b=BF2U1R36eAkUq/BlZhCejqjQMWaWAi57y9hsfA5aIgETUu81ieZ+frMIm7PEVma5O O1hct06Ej3e7Z6XS01qfyPIyk2957TVCdYbWEmlHg2rmmw1ZZG6/qNOpsyRROOTtjT AA4Gj4MdCZh9QU/0zTUAZauI8AmOTb2m/wYfIb6g= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727964AbgEQLxr (ORCPT ); Sun, 17 May 2020 07:53:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:38988 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727833AbgEQLxq (ORCPT ); Sun, 17 May 2020 07:53:46 -0400 Received: from localhost (unknown [213.57.247.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B0285206F4; Sun, 17 May 2020 11:53:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589716426; bh=9FsYMlSfeCJWncuLjQ3mbr2AKny28mgZM1pKTVtJH+0=; h=From:To:Cc:Subject:Date:From; b=izz1rlgYRMsOwX7HHtLlNSTYQSiEacpAbkDdtQ+n3Txs1WrGDi3zTxZ+okrdd11gx 2ujG2OmdbW7DsF4j2bkS9rJAPjoFT3KMO+ph16PAOhfvvCe+130aSrLbiM8dEL+wNi VvJR4Myn2x60RiTnQy3xct56HhjH+qyhMUk2JA90= From: Leon Romanovsky To: Andrew Lunn , "David S. Miller" , Jakub Kicinski , Florian Fainelli , Heiner Kallweit Cc: Leon Romanovsky , netdev@vger.kernel.org, Russell King Subject: [PATCH net] net: phy: propagate an error back to the callers of phy_sfp_probe Date: Sun, 17 May 2020 14:53:40 +0300 Message-Id: <20200517115340.78554-1-leon@kernel.org> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Leon Romanovsky The compilation warning below reveals that the errors returned from the sfp_bus_add_upstream() call are not propagated to the callers. Fix it by returning "ret". 14:37:51 drivers/net/phy/phy_device.c: In function 'phy_sfp_probe': 14:37:51 drivers/net/phy/phy_device.c:1236:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable] 14:37:51 1236 | int ret; 14:37:51 | ^~~ Fixes: 298e54fa810e ("net: phy: add core phylib sfp support") Signed-off-by: Leon Romanovsky --- drivers/net/phy/phy_device.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index ac2784192472..697c74deb222 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -1233,7 +1233,7 @@ int phy_sfp_probe(struct phy_device *phydev, const struct sfp_upstream_ops *ops) { struct sfp_bus *bus; - int ret; + int ret = 0; if (phydev->mdio.dev.fwnode) { bus = sfp_bus_find_fwnode(phydev->mdio.dev.fwnode); @@ -1245,7 +1245,7 @@ int phy_sfp_probe(struct phy_device *phydev, ret = sfp_bus_add_upstream(bus, phydev, ops); sfp_bus_put(bus); } - return 0; + return ret; } EXPORT_SYMBOL(phy_sfp_probe); -- 2.26.2