Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

thunderbolt: Add tb_switch_get()

Sometimes there is need for increasing reference count of a switch as
well. This also follows what we have for xdomains.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

+7
+7
drivers/thunderbolt/tb.h
··· 387 387 u8 depth); 388 388 struct tb_switch *tb_switch_find_by_uuid(struct tb *tb, const uuid_t *uuid); 389 389 390 + static inline struct tb_switch *tb_switch_get(struct tb_switch *sw) 391 + { 392 + if (sw) 393 + get_device(&sw->dev); 394 + return sw; 395 + } 396 + 390 397 static inline void tb_switch_put(struct tb_switch *sw) 391 398 { 392 399 put_device(&sw->dev);