From patchwork Tue Apr 28 18:25:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 226801 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=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT 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 7640EC8300A for ; Tue, 28 Apr 2020 18:51:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 504B9206D6 for ; Tue, 28 Apr 2020 18:51:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588099878; bh=JHaBNosCj1zG89vJZojwMlcYslKrzJGKsmuORnY+RAk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=uYTeWk9RPGJgEoN+XfbUgAHp+4Gfnqst/WwGOU2PvnbWb/jBLBzVFbbfFhkml+swj uI7Dx681CJ1dRAfJFkl80PI5whBx3PEG2N3pNWSvECBHcn1X4PGg6Vt1hxoO3YJvo0 dZ9pA12H4Aynh+kn4n87cVPiUIaz+hOwSGKFJFFM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730488AbgD1Sh0 (ORCPT ); Tue, 28 Apr 2020 14:37:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:55486 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730483AbgD1Sh0 (ORCPT ); Tue, 28 Apr 2020 14:37:26 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 41F2520575; Tue, 28 Apr 2020 18:37:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588099045; bh=JHaBNosCj1zG89vJZojwMlcYslKrzJGKsmuORnY+RAk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dqoJplVVfYvsO9zTY2X/BMAzTST2Szpuymo0Z8BRfbL+wjcCO/y9Wo7lS4tgiTI9L NxFWXdzHac6++B2tnMpS4/ltDg6p7aiMs+wKW2HDylRDjfSie7LxEafNMVWNw5YkbX 5jqocjxKmZZHj0sCfgc1SDgyK/zVAb5rUATD3xTs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Xu Yilun , Wu Hao , Moritz Fischer Subject: [PATCH 5.6 148/167] fpga: dfl: pci: fix return value of cci_pci_sriov_configure Date: Tue, 28 Apr 2020 20:25:24 +0200 Message-Id: <20200428182244.291758805@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200428182225.451225420@linuxfoundation.org> References: <20200428182225.451225420@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Xu Yilun commit 3c2760b78f90db874401d97e3c17829e2e36f400 upstream. pci_driver.sriov_configure should return negative value on error and number of enabled VFs on success. But now the driver returns 0 on success. The sriov configure still works but will cause a warning message: XX VFs requested; only 0 enabled This patch changes the return value accordingly. Cc: stable@vger.kernel.org Signed-off-by: Xu Yilun Signed-off-by: Wu Hao Signed-off-by: Moritz Fischer Signed-off-by: Greg Kroah-Hartman --- drivers/fpga/dfl-pci.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- a/drivers/fpga/dfl-pci.c +++ b/drivers/fpga/dfl-pci.c @@ -248,11 +248,13 @@ static int cci_pci_sriov_configure(struc return ret; ret = pci_enable_sriov(pcidev, num_vfs); - if (ret) + if (ret) { dfl_fpga_cdev_config_ports_pf(cdev); + return ret; + } } - return ret; + return num_vfs; } static void cci_pci_remove(struct pci_dev *pcidev)