[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220323140215.2568-1-andriy.shevchenko@linux.intel.com>
Date: Wed, 23 Mar 2022 16:02:12 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
linux-spi@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: Mark Brown <broonie@...nel.org>
Subject: [PATCH v1 1/4] spidev: Do not use atomic bit operations when allocating minor
There is no need to use atomic bit operations when allocating a minor
number since it's done under a mutex. Moreover, one of the operations
that is in use is non-atomic anyway.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
---
drivers/spi/spidev.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c
index 53a551714265..daeaa4a30290 100644
--- a/drivers/spi/spidev.c
+++ b/drivers/spi/spidev.c
@@ -795,7 +795,7 @@ static int spidev_probe(struct spi_device *spi)
status = -ENODEV;
}
if (status == 0) {
- set_bit(minor, minors);
+ __set_bit(minor, minors);
list_add(&spidev->device_entry, &device_list);
}
mutex_unlock(&device_list_lock);
@@ -823,7 +823,7 @@ static void spidev_remove(struct spi_device *spi)
list_del(&spidev->device_entry);
device_destroy(spidev_class, spidev->devt);
- clear_bit(MINOR(spidev->devt), minors);
+ __clear_bit(MINOR(spidev->devt), minors);
if (spidev->users == 0)
kfree(spidev);
mutex_unlock(&device_list_lock);
--
2.35.1
Powered by blists - more mailing lists