thunderbolt: Refactor add_switch() into two functions
authorMika Westerberg <mika.westerberg@linux.intel.com>
Tue, 8 Oct 2019 16:03:34 +0000 (19:03 +0300)
committerMika Westerberg <mika.westerberg@linux.intel.com>
Fri, 1 Nov 2019 11:32:00 +0000 (14:32 +0300)
commitb5db76dba0642ea6f2391374f3b2b479014e5bf0
tree1a8f681791bfc0661450d548ff16b0f7194d5bbe
parentb433d0100562233b21beb13c0139feeff350bc68
thunderbolt: Refactor add_switch() into two functions

Currently add_switch() takes a huge amount of parameters that makes it
hard to maintain. Instead of passing all those parameters we can split
the function into two parts (alloc and add) and fill the additional
switch fields directly in the functions calling those.

While there remove redundant error logging in case kmemdup() fails.

No functional changes.

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