Commit 2b2da409 authored by Charles Keepax's avatar Charles Keepax Committed by Vinod Koul
Browse files

soundwire: stream: Remove unneeded checks for NULL bus



Version of the code prior to commit d014688e ("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: default avatarCharles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230602101140.2040141-3-ckeepax@opensource.cirrus.com


Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent 6eedc227
Loading
Loading
Loading
Loading
+2 −12
Original line number Original line Diff line number Diff line
@@ -1338,7 +1338,7 @@ static int _sdw_prepare_stream(struct sdw_stream_runtime *stream,
			       bool update_params)
			       bool update_params)
{
{
	struct sdw_master_runtime *m_rt;
	struct sdw_master_runtime *m_rt;
	struct sdw_bus *bus = NULL;
	struct sdw_bus *bus;
	struct sdw_master_prop *prop;
	struct sdw_master_prop *prop;
	struct sdw_bus_params params;
	struct sdw_bus_params params;
	int ret;
	int ret;
@@ -1382,11 +1382,6 @@ static int _sdw_prepare_stream(struct sdw_stream_runtime *stream,
		}
		}
	}
	}


	if (!bus) {
		pr_err("Configuration error in %s\n", __func__);
		return -EINVAL;
	}

	ret = do_bank_switch(stream);
	ret = do_bank_switch(stream);
	if (ret < 0) {
	if (ret < 0) {
		pr_err("%s: do_bank_switch failed: %d\n", __func__, ret);
		pr_err("%s: do_bank_switch failed: %d\n", __func__, ret);
@@ -1467,7 +1462,7 @@ EXPORT_SYMBOL(sdw_prepare_stream);
static int _sdw_enable_stream(struct sdw_stream_runtime *stream)
static int _sdw_enable_stream(struct sdw_stream_runtime *stream)
{
{
	struct sdw_master_runtime *m_rt;
	struct sdw_master_runtime *m_rt;
	struct sdw_bus *bus = NULL;
	struct sdw_bus *bus;
	int ret;
	int ret;


	/* Enable Master(s) and Slave(s) port(s) associated with stream */
	/* 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)
		}
		}
	}
	}


	if (!bus) {
		pr_err("Configuration error in %s\n", __func__);
		return -EINVAL;
	}

	ret = do_bank_switch(stream);
	ret = do_bank_switch(stream);
	if (ret < 0) {
	if (ret < 0) {
		pr_err("%s: do_bank_switch failed: %d\n", __func__, ret);
		pr_err("%s: do_bank_switch failed: %d\n", __func__, ret);