Skip to content

Commit 55d50ac

Browse files
bardliaovinodkoul
authored andcommitted
soundwire: generic_bandwidth_allocation use bus->params.max_dr_freq
bus->params.max_dr_freq is calculated and set in sdw_bus_master_add(). We can use it directly instead of calculating it again. Signed-off-by: Bard Liao <[email protected]> Reviewed-by: Pierre-Louis Bossart <[email protected]> Reviewed-by: Rander Wang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent a7ae05e commit 55d50ac

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

drivers/soundwire/generic_bandwidth_allocation.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ static int sdw_select_row_col(struct sdw_bus *bus, int clk_freq)
333333
*/
334334
static int sdw_compute_bus_params(struct sdw_bus *bus)
335335
{
336-
unsigned int max_dr_freq, curr_dr_freq = 0;
336+
unsigned int curr_dr_freq = 0;
337337
struct sdw_master_prop *mstr_prop = &bus->prop;
338338
int i, clk_values, ret;
339339
bool is_gear = false;
@@ -351,14 +351,12 @@ static int sdw_compute_bus_params(struct sdw_bus *bus)
351351
clk_buf = NULL;
352352
}
353353

354-
max_dr_freq = mstr_prop->max_clk_freq * SDW_DOUBLE_RATE_FACTOR;
355-
356354
for (i = 0; i < clk_values; i++) {
357355
if (!clk_buf)
358-
curr_dr_freq = max_dr_freq;
356+
curr_dr_freq = bus->params.max_dr_freq;
359357
else
360358
curr_dr_freq = (is_gear) ?
361-
(max_dr_freq >> clk_buf[i]) :
359+
(bus->params.max_dr_freq >> clk_buf[i]) :
362360
clk_buf[i] * SDW_DOUBLE_RATE_FACTOR;
363361

364362
if (curr_dr_freq <= bus->params.bandwidth)

0 commit comments

Comments
 (0)