Commit 93bf344f authored by Gil Fine's avatar Gil Fine Committed by Mika Westerberg

thunderbolt: Fix buffer allocation of devices with no DisplayPort adapters

For the case of a device without DisplayPort adapters we calculate
incorrectly the amount of buffers. Fix the calculation for this case.
Signed-off-by: default avatarGil Fine <gil.fine@intel.com>
Signed-off-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
parent 8e1de704
...@@ -102,8 +102,11 @@ static unsigned int tb_available_credits(const struct tb_port *port, ...@@ -102,8 +102,11 @@ static unsigned int tb_available_credits(const struct tb_port *port,
* Maximum number of DP streams possible through the * Maximum number of DP streams possible through the
* lane adapter. * lane adapter.
*/ */
ndp = (credits - (usb3 + pcie + spare)) / if (sw->min_dp_aux_credits + sw->min_dp_main_credits)
(sw->min_dp_aux_credits + sw->min_dp_main_credits); ndp = (credits - (usb3 + pcie + spare)) /
(sw->min_dp_aux_credits + sw->min_dp_main_credits);
else
ndp = 0;
} else { } else {
ndp = 0; ndp = 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment