Commit 31dba312 authored by Pierre-Louis Bossart's avatar Pierre-Louis Bossart Committed by Greg Kroah-Hartman
Browse files

soundwire: mipi_disco: fix alignment issues



Use Linux style. In some cases parenthesis alignment is modified to
keep the code readable.

Reviewed-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 74a8d802
Loading
Loading
Loading
Loading
+62 −50
Original line number Diff line number Diff line
@@ -35,7 +35,8 @@ int sdw_master_read_prop(struct sdw_bus *bus)
	int nval, i;

	device_property_read_u32(bus->dev,
			"mipi-sdw-sw-interface-revision", &prop->revision);
				 "mipi-sdw-sw-interface-revision",
				 &prop->revision);

	/* Find master handle */
	snprintf(name, sizeof(name),
@@ -56,7 +57,8 @@ int sdw_master_read_prop(struct sdw_bus *bus)
		prop->clk_stop_mode |= SDW_CLK_STOP_MODE1;

	fwnode_property_read_u32(link,
			"mipi-sdw-max-clock-frequency", &prop->max_freq);
				 "mipi-sdw-max-clock-frequency",
				 &prop->max_freq);

	nval = fwnode_property_read_u32_array(link,
			"mipi-sdw-clock-frequencies-supported", NULL, 0);
@@ -91,13 +93,15 @@ int sdw_master_read_prop(struct sdw_bus *bus)

		prop->num_clk_gears = nval;
		prop->clk_gears = devm_kcalloc(bus->dev, prop->num_clk_gears,
				sizeof(*prop->clk_gears), GFP_KERNEL);
					       sizeof(*prop->clk_gears),
					       GFP_KERNEL);
		if (!prop->clk_gears)
			return -ENOMEM;

		fwnode_property_read_u32_array(link,
					       "mipi-sdw-supported-clock-gears",
				prop->clk_gears, prop->num_clk_gears);
					       prop->clk_gears,
					       prop->num_clk_gears);
	}

	fwnode_property_read_u32(link, "mipi-sdw-default-frame-rate",
@@ -120,7 +124,8 @@ int sdw_master_read_prop(struct sdw_bus *bus)
EXPORT_SYMBOL(sdw_master_read_prop);

static int sdw_slave_read_dp0(struct sdw_slave *slave,
		struct fwnode_handle *port, struct sdw_dp0_prop *dp0)
			      struct fwnode_handle *port,
			      struct sdw_dp0_prop *dp0)
{
	int nval;

@@ -146,20 +151,21 @@ static int sdw_slave_read_dp0(struct sdw_slave *slave,
				dp0->words, dp0->num_words);
	}

	dp0->flow_controlled = fwnode_property_read_bool(
			port, "mipi-sdw-bra-flow-controlled");
	dp0->flow_controlled = fwnode_property_read_bool(port,
				"mipi-sdw-bra-flow-controlled");

	dp0->simple_ch_prep_sm = fwnode_property_read_bool(
			port, "mipi-sdw-simplified-channel-prepare-sm");
	dp0->simple_ch_prep_sm = fwnode_property_read_bool(port,
				"mipi-sdw-simplified-channel-prepare-sm");

	dp0->device_interrupts = fwnode_property_read_bool(
			port, "mipi-sdw-imp-def-dp0-interrupts-supported");
	dp0->device_interrupts = fwnode_property_read_bool(port,
				"mipi-sdw-imp-def-dp0-interrupts-supported");

	return 0;
}

static int sdw_slave_read_dpn(struct sdw_slave *slave,
		struct sdw_dpn_prop *dpn, int count, int ports, char *type)
			      struct sdw_dpn_prop *dpn, int count, int ports,
			      char *type)
{
	struct fwnode_handle *node;
	u32 bit, i = 0;
@@ -195,7 +201,8 @@ static int sdw_slave_read_dpn(struct sdw_slave *slave,
			dpn[i].num_words = nval;
			dpn[i].words = devm_kcalloc(&slave->dev,
						    dpn[i].num_words,
					sizeof(*dpn[i].words), GFP_KERNEL);
						    sizeof(*dpn[i].words),
						    GFP_KERNEL);
			if (!dpn[i].words)
				return -ENOMEM;

@@ -234,7 +241,8 @@ static int sdw_slave_read_dpn(struct sdw_slave *slave,

			dpn[i].num_ch = nval;
			dpn[i].ch = devm_kcalloc(&slave->dev, dpn[i].num_ch,
					sizeof(*dpn[i].ch), GFP_KERNEL);
						 sizeof(*dpn[i].ch),
						 GFP_KERNEL);
			if (!dpn[i].ch)
				return -ENOMEM;

@@ -348,7 +356,8 @@ int sdw_slave_read_prop(struct sdw_slave *slave)
	} else {

		prop->dp0_prop = devm_kzalloc(&slave->dev,
				sizeof(*prop->dp0_prop), GFP_KERNEL);
					      sizeof(*prop->dp0_prop),
					      GFP_KERNEL);
		if (!prop->dp0_prop)
			return -ENOMEM;

@@ -364,7 +373,8 @@ int sdw_slave_read_prop(struct sdw_slave *slave)
	/* Allocate memory for set bits in port lists */
	nval = hweight32(prop->source_ports);
	prop->src_dpn_prop = devm_kcalloc(&slave->dev, nval,
				sizeof(*prop->src_dpn_prop), GFP_KERNEL);
					  sizeof(*prop->src_dpn_prop),
					  GFP_KERNEL);
	if (!prop->src_dpn_prop)
		return -ENOMEM;

@@ -374,7 +384,8 @@ int sdw_slave_read_prop(struct sdw_slave *slave)

	nval = hweight32(prop->sink_ports);
	prop->sink_dpn_prop = devm_kcalloc(&slave->dev, nval,
				sizeof(*prop->sink_dpn_prop), GFP_KERNEL);
					   sizeof(*prop->sink_dpn_prop),
					   GFP_KERNEL);
	if (!prop->sink_dpn_prop)
		return -ENOMEM;

@@ -388,7 +399,8 @@ int sdw_slave_read_prop(struct sdw_slave *slave)

	/* Allocate port_ready based on num_of_ports */
	slave->port_ready = devm_kcalloc(&slave->dev, num_of_ports,
				sizeof(*slave->port_ready), GFP_KERNEL);
					 sizeof(*slave->port_ready),
					 GFP_KERNEL);
	if (!slave->port_ready)
		return -ENOMEM;