From patchwork Mon Oct 12 19:14:10 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Patterson X-Patchwork-Id: 53194 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n9CJQhFM032411 for ; Mon, 12 Oct 2009 19:26:44 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933102AbZJLTO6 (ORCPT ); Mon, 12 Oct 2009 15:14:58 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757545AbZJLTOt (ORCPT ); Mon, 12 Oct 2009 15:14:49 -0400 Received: from g6t0185.atlanta.hp.com ([15.193.32.62]:46194 "EHLO g6t0185.atlanta.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933090AbZJLTOs (ORCPT ); Mon, 12 Oct 2009 15:14:48 -0400 Received: from g5t0030.atlanta.hp.com (g5t0030.atlanta.hp.com [16.228.8.142]) by g6t0185.atlanta.hp.com (Postfix) with ESMTP id A150A240D6; Mon, 12 Oct 2009 19:14:10 +0000 (UTC) Received: from ldl (linux.corp.hp.com [15.11.146.101]) by g5t0030.atlanta.hp.com (Postfix) with ESMTP id 8AC6224006; Mon, 12 Oct 2009 19:14:10 +0000 (UTC) Received: from localhost (ldl.fc.hp.com [127.0.0.1]) by ldl (Postfix) with ESMTP id 5C258CF00F2; Mon, 12 Oct 2009 13:14:10 -0600 (MDT) Received: from ldl ([127.0.0.1]) by localhost (ldl.fc.hp.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id eiNxi7xSSIPt; Mon, 12 Oct 2009 13:14:10 -0600 (MDT) Received: from eh.fc.hp.com (eh.fc.hp.com [15.11.146.105]) by ldl (Postfix) with ESMTP id 46B51CF00E9; Mon, 12 Oct 2009 13:14:10 -0600 (MDT) Received: from bob.kio (localhost [127.0.0.1]) by eh.fc.hp.com (Postfix) with ESMTP id 30DE426160; Mon, 12 Oct 2009 13:14:10 -0600 (MDT) Subject: [PATCH v2 3/4] PCI: use better error return values in aer_inject To: ying.huang@intel.com From: Andrew Patterson Cc: prarit@redhat.com, linux-pci@vger.kernel.org, andi@firstfloor.org, linux-kernel@vger.kernel.org, jbarnes@virtuousgeek.org Date: Mon, 12 Oct 2009 13:14:10 -0600 Message-ID: <20091012191410.14959.32732.stgit@bob.kio> In-Reply-To: <20091012191354.14959.47024.stgit@bob.kio> References: <20091012191354.14959.47024.stgit@bob.kio> User-Agent: StGit/0.14.3.386.gb02d MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org diff --git a/drivers/pci/pcie/aer/aer_inject.c b/drivers/pci/pcie/aer/aer_inject.c index ac0b5e7..da2ad6e 100644 --- a/drivers/pci/pcie/aer/aer_inject.c +++ b/drivers/pci/pcie/aer/aer_inject.c @@ -326,23 +326,23 @@ static int aer_inject(struct aer_error_inj *einj) dev = pci_get_domain_bus_and_slot((int)einj->domain, einj->bus, devfn); if (!dev) - return -EINVAL; + return -ENODEV; rpdev = pcie_find_root_port(dev); if (!rpdev) { - ret = -EINVAL; + ret = -ENOTTY; goto out_put; } pos_cap_err = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ERR); if (!pos_cap_err) { - ret = -EIO; + ret = -ENOTTY; goto out_put; } pci_read_config_dword(dev, pos_cap_err + PCI_ERR_UNCOR_SEVER, &sever); rp_pos_cap_err = pci_find_ext_capability(rpdev, PCI_EXT_CAP_ID_ERR); if (!rp_pos_cap_err) { - ret = -EIO; + ret = -ENOTTY; goto out_put; }