thunderbolt: Make tb_switch_alloc() return ERR_PTR()
authorMika Westerberg <mika.westerberg@linux.intel.com>
Sun, 30 Dec 2018 10:17:52 +0000 (12:17 +0200)
committerMika Westerberg <mika.westerberg@linux.intel.com>
Thu, 18 Apr 2019 08:18:53 +0000 (11:18 +0300)
commit444ac3844895c34ab71ffcec1b3199449d3434a4
tree740d894bc76d652b3b763457dfbd28be9d2cc63a
parent44242d6c9703208e7e7abd6b4dbb258a930dd01a
thunderbolt: Make tb_switch_alloc() return ERR_PTR()

In order to detect possible connections to other domains we need to be
able to find out why tb_switch_alloc() fails so make it return ERR_PTR()
instead. This allows the caller to differentiate between errors such as
-ENOMEM which comes from the kernel and for instance -EIO which comes
from the hardware when trying to access the possible switch.

Convert all the current call sites to handle this properly.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
drivers/thunderbolt/icm.c
drivers/thunderbolt/switch.c
drivers/thunderbolt/tb.c