“7cff7ce94a7df2ccf5ac76b48ee0995fee2060df”上不存在“include/linux/compiler-gcc5.h”
未验证 提交 6bfb15f3 编写于 作者: U Uwe Kleine-König 提交者: Mark Brown

spi: Move comment about chipselect check to the right place

The part of the comment about locking isn't that relevant compared to
the chip select check. So drop the sentence about locking.
Signed-off-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20211007121415.2401638-2-u.kleine-koenig@pengutronix.deSigned-off-by: NMark Brown <broonie@kernel.org>
上级 9e1ff307
...@@ -564,6 +564,11 @@ static int __spi_add_device(struct spi_device *spi) ...@@ -564,6 +564,11 @@ static int __spi_add_device(struct spi_device *spi)
struct device *dev = ctlr->dev.parent; struct device *dev = ctlr->dev.parent;
int status; int status;
/*
* We need to make sure there's no other device with this
* chipselect **BEFORE** we call setup(), else we'll trash
* its configuration.
*/
status = bus_for_each_dev(&spi_bus_type, NULL, spi, spi_dev_check); status = bus_for_each_dev(&spi_bus_type, NULL, spi, spi_dev_check);
if (status) { if (status) {
dev_err(dev, "chipselect %d already in use\n", dev_err(dev, "chipselect %d already in use\n",
...@@ -632,10 +637,6 @@ int spi_add_device(struct spi_device *spi) ...@@ -632,10 +637,6 @@ int spi_add_device(struct spi_device *spi)
/* Set the bus ID string */ /* Set the bus ID string */
spi_dev_set_name(spi); spi_dev_set_name(spi);
/* We need to make sure there's no other device with this
* chipselect **BEFORE** we call setup(), else we'll trash
* its configuration. Lock against concurrent add() calls.
*/
mutex_lock(&spi_add_lock); mutex_lock(&spi_add_lock);
status = __spi_add_device(spi); status = __spi_add_device(spi);
mutex_unlock(&spi_add_lock); mutex_unlock(&spi_add_lock);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册