[PATCH 04/19] thunderbolt: Do not overwrite error code when domain adding fails

Anthony Wong anthony.wong at canonical.com
Wed Mar 28 12:31:11 UTC 2018

From: Mika Westerberg <mika.westerberg at linux.intel.com>

If the Thunderbolt domain adding fails for some reason we currently
always return -EIO instead of the real error code. To make debugging
easier return the actual error code instead.

Signed-off-by: Mika Westerberg <mika.westerberg at linux.intel.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko at gmail.com>
(cherry picked from commit 68a7a2ace13156b8a3d8cd6cceab6c30b52e2923)
Signed-off-by: Anthony Wong <anthony.wong at canonical.com>
 drivers/thunderbolt/nhi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/thunderbolt/nhi.c b/drivers/thunderbolt/nhi.c
index 80c33c7..9e58d09 100644
--- a/drivers/thunderbolt/nhi.c
+++ b/drivers/thunderbolt/nhi.c
@@ -1036,7 +1036,7 @@ static int nhi_probe(struct pci_dev *pdev, const struct pci_device_id *id)
-		return -EIO;
+		return res;
 	pci_set_drvdata(pdev, tb);

More information about the kernel-team mailing list