Commit 9a9a047a authored by Suniel Mahesh's avatar Suniel Mahesh Committed by Mark Brown
Browse files

spi: Kernel coding style fixes



Earlier commit:
"spi: Pick spi bus number from Linux idr or spi alias"
(SHA1:9b61e302)
has introduced some checkpatch issues. As pointed by
Lukas Wunner this patch does the following:
- remove whitespaces
- fix warnings, suspect code indent for conditional statements
- fix errors, code indent should use tabs
- remove spaces at the start of the line

Signed-off-by: default avatarSuniel Mahesh <sunil.m@techveda.org>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 9b61e302
Loading
Loading
Loading
Loading
+12 −17
Original line number Diff line number Diff line
@@ -2075,7 +2075,6 @@ int spi_register_controller(struct spi_controller *ctlr)
	 */
	if (ctlr->num_chipselect == 0)
		return -EINVAL;
	
	/* allocate dynamic bus number using Linux idr */
	if ((ctlr->bus_num < 0) && ctlr->dev.of_node) {
		id = of_alias_get_id(ctlr->dev.of_node, "spi");
@@ -2091,15 +2090,13 @@ int spi_register_controller(struct spi_controller *ctlr)
	}
	if (ctlr->bus_num < 0) {
		mutex_lock(&board_lock);
			id = idr_alloc(&spi_master_idr, ctlr,
				       SPI_DYN_FIRST_BUS_NUM, 0, GFP_KERNEL);
		id = idr_alloc(&spi_master_idr, ctlr, SPI_DYN_FIRST_BUS_NUM, 0,
			       GFP_KERNEL);
		mutex_unlock(&board_lock);
		if (WARN(id < 0, "couldn't get idr"))
			return id;

		ctlr->bus_num = id;
	}

	INIT_LIST_HEAD(&ctlr->queue);
	spin_lock_init(&ctlr->queue_lock);
	spin_lock_init(&ctlr->bus_lock_spinlock);
@@ -2228,12 +2225,10 @@ void spi_unregister_controller(struct spi_controller *ctlr)
			dev_name(&ctlr->dev));
		return;
	}

	if (ctlr->queued) {
		if (spi_destroy_queue(ctlr))
			dev_err(&ctlr->dev, "queue remove failed\n");
	}

	mutex_lock(&board_lock);
	list_del(&ctlr->list);
	mutex_unlock(&board_lock);