Skip to content

Commit 2b2da40

Browse files
charleskeepaxvinodkoul
authored andcommitted
soundwire: stream: Remove unneeded checks for NULL bus
Version of the code prior to commit d014688 ("soundwire: stream: remove bus->dev from logs on multiple buses"), used bus->dev in the error message after do_bank_switch, this necessitated some checking to ensure the bus pointer was valid. As the code no longer uses bus->dev said checking is now redundant, so remove it. Signed-off-by: Charles Keepax <[email protected]> Reviewed-by: Pierre-Louis Bossart <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent 6eedc22 commit 2b2da40

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

drivers/soundwire/stream.c

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1338,7 +1338,7 @@ static int _sdw_prepare_stream(struct sdw_stream_runtime *stream,
13381338
bool update_params)
13391339
{
13401340
struct sdw_master_runtime *m_rt;
1341-
struct sdw_bus *bus = NULL;
1341+
struct sdw_bus *bus;
13421342
struct sdw_master_prop *prop;
13431343
struct sdw_bus_params params;
13441344
int ret;
@@ -1382,11 +1382,6 @@ static int _sdw_prepare_stream(struct sdw_stream_runtime *stream,
13821382
}
13831383
}
13841384

1385-
if (!bus) {
1386-
pr_err("Configuration error in %s\n", __func__);
1387-
return -EINVAL;
1388-
}
1389-
13901385
ret = do_bank_switch(stream);
13911386
if (ret < 0) {
13921387
pr_err("%s: do_bank_switch failed: %d\n", __func__, ret);
@@ -1467,7 +1462,7 @@ EXPORT_SYMBOL(sdw_prepare_stream);
14671462
static int _sdw_enable_stream(struct sdw_stream_runtime *stream)
14681463
{
14691464
struct sdw_master_runtime *m_rt;
1470-
struct sdw_bus *bus = NULL;
1465+
struct sdw_bus *bus;
14711466
int ret;
14721467

14731468
/* Enable Master(s) and Slave(s) port(s) associated with stream */
@@ -1490,11 +1485,6 @@ static int _sdw_enable_stream(struct sdw_stream_runtime *stream)
14901485
}
14911486
}
14921487

1493-
if (!bus) {
1494-
pr_err("Configuration error in %s\n", __func__);
1495-
return -EINVAL;
1496-
}
1497-
14981488
ret = do_bank_switch(stream);
14991489
if (ret < 0) {
15001490
pr_err("%s: do_bank_switch failed: %d\n", __func__, ret);

0 commit comments

Comments
 (0)