Skip to contentSkip to conversation

patch "iio: adc: ti-ads7950: Set `can_sleep` flag for GPIO chip" added to char-misc-linus

PATCH [email protected] 1 participant 1 message Mar 28, 2023

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

iio: adc: ti-ads7950: Set can_sleep flag for GPIO chip

to my char-misc git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git
in the char-misc-linus branch.

The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)

The patch will hopefully also be merged in Linus's tree for the next -rc kernel release.

If you have any questions about this process, please let me know.

From 363c7dc72f79edd55bf1c4380e0fbf7f1bbc2c86 Mon Sep 17 00:00:00 2001
From: Lars-Peter Clausen <[email protected]>
Date: Sun, 12 Mar 2023 14:09:33 -0700
Subject: iio: adc: ti-ads7950: Set can_sleep flag for GPIO chip

The ads7950 uses a mutex as well as SPI transfers in its GPIO callbacks. This means these callbacks can sleep and the can_sleep flag should be set.

Having the flag set will make sure that warnings are generated when calling any of the callbacks from a potentially non-sleeping context.

---
 drivers/iio/adc/ti-ads7950.c | 1 +
 1 file changed, 1 insertion(+)
drivers/iio/adc/ti-ads7950.c +1 -0
index 2cc9a9bd9db6..263fc3a1b87e 100644
@@ -634,6 +634,7 @@ static int ti_ads7950_probe(struct spi_device *spi)
 	st->chip.label = dev_name(&st->spi->dev);
 	st->chip.parent = &st->spi->dev;
 	st->chip.owner = THIS_MODULE;
+	st->chip.can_sleep = true;
 	st->chip.base = -1;
 	st->chip.ngpio = TI_ADS7950_NUM_GPIOS;
 	st->chip.get_direction = ti_ads7950_get_direction;
Signature · 1 line
2.40.0