From patchwork Thu Oct 15 01:35:13 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Krause X-Patchwork-Id: 530559 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ozlabs.org (Postfix) with ESMTP id 4573C1402B3 for ; Thu, 15 Oct 2015 19:11:40 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=DZpLhFjK; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 37D4E26A24; Thu, 15 Oct 2015 08:11:40 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id i7Zupjl3T447; Thu, 15 Oct 2015 08:11:39 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 1BECD26AB0; Thu, 15 Oct 2015 08:11:39 +0000 (UTC) X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 049B11C1566 for ; Thu, 15 Oct 2015 01:35:18 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id F06BF8C0F2 for ; Thu, 15 Oct 2015 01:35:17 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id llm0P8S8moAn for ; Thu, 15 Oct 2015 01:35:17 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ig0-f195.google.com (mail-ig0-f195.google.com [209.85.213.195]) by whitealder.osuosl.org (Postfix) with ESMTPS id 789448C22E for ; Thu, 15 Oct 2015 01:35:17 +0000 (UTC) Received: by igbzj1 with SMTP id zj1so6951076igb.0 for ; Wed, 14 Oct 2015 18:35:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=wZsfGinDL+48bL5VcYxn6EoGYKdgJwBRigE9mLIbkuA=; b=DZpLhFjKKtlZmBG8RWyLI+o4PbHWZ7WAOIGJkBEVnWyNUADk3UPfGAwxdAYAc5Rf9x 2AAM0d4Ceuis5wFHo1J/klHE/CI4G3JC8rSenRLeW59m0Q7/oORz9ClNEkgHbN99c4qI dU7fcm5w8H3BtlCOLFqdt088DN1I/YJV4i5hLhUf4Hk9u6dxsKg6Mq88migqNerGNIDa d4LZS6ufctWqvys1ZAHIZOpNIfPXRQt0yQBnFHI+DPzJMrXezQEJfZrYUXw3k5czyav8 6o+TlBL5dvY83OH7tYqmm0sHxyED5BWe0Te0rgolZfdMKv3TCWh89zI1rg3tS5Cru27W JoIQ== X-Received: by 10.50.79.169 with SMTP id k9mr7636251igx.40.1444872916905; Wed, 14 Oct 2015 18:35:16 -0700 (PDT) Received: from nick-System-Product-Name.hitronhub.home (CPEbc4dfb2691f3-CMbc4dfb2691f0.cpe.net.cable.rogers.com. [99.231.110.121]) by smtp.googlemail.com with ESMTPSA id x1sm10200429igl.14.2015.10.14.18.35.15 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 14 Oct 2015 18:35:16 -0700 (PDT) From: Nicholas Krause To: jeffrey.t.kirsher@intel.com Date: Wed, 14 Oct 2015 21:35:13 -0400 Message-Id: <1444872913-32140-1-git-send-email-xerofoify@gmail.com> X-Mailer: git-send-email 2.1.4 X-Mailman-Approved-At: Thu, 15 Oct 2015 08:11:37 +0000 Cc: linux-kernel@vger.kernel.org, intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org Subject: [Intel-wired-lan] [PATCH RESEND] i40e:Return -ENODEV if hardware has no support for certain required features in the function i40e_init_pf_fcoe X-BeenThere: intel-wired-lan@lists.osuosl.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-wired-lan-bounces@lists.osuosl.org Sender: "Intel-wired-lan" This makes the function i40e_init_pf_fcoe correctly return -ENODEV as a error return for when the underlying hardware does not have support for FCOE or DCB rather then 0 to it's callers in order to comply with checks run by these particular function's callers to find out if the underlying hardware supports these features. Signed-off-by: Nicholas Krause --- drivers/net/ethernet/intel/i40e/i40e_fcoe.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/intel/i40e/i40e_fcoe.c b/drivers/net/ethernet/intel/i40e/i40e_fcoe.c index c8b621e..24a44dd 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_fcoe.c +++ b/drivers/net/ethernet/intel/i40e/i40e_fcoe.c @@ -273,7 +273,8 @@ out: * i40e_fcoe_sw_init - sets up the HW for FCoE * @pf: pointer to PF * - * Returns 0 if FCoE is supported otherwise the error code + * Returns 0 if FCoE is supported otherwise -ENODEV if + * the hardware does not support it **/ int i40e_init_pf_fcoe(struct i40e_pf *pf) { @@ -287,13 +288,13 @@ int i40e_init_pf_fcoe(struct i40e_pf *pf) if (!pf->hw.func_caps.fcoe) { dev_info(&pf->pdev->dev, "FCoE capability is disabled\n"); - return 0; + return -ENODEV; } if (!pf->hw.func_caps.dcb) { dev_warn(&pf->pdev->dev, "Hardware is not DCB capable not enabling FCoE.\n"); - return 0; + return -ENODEV; } /* enable FCoE hash filter */