Skip to content

Commit 363c7dc

Browse files
larsclausenjic23
authored andcommitted
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. Fixes: c97dce7 ("iio: adc: ti-ads7950: add GPIO support") Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: David Lechner <david@lechnology.com> Link: https://lore.kernel.org/r/20230312210933.2275376-1-lars@metafoo.de Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
1 parent 49f76c4 commit 363c7dc

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/iio/adc/ti-ads7950.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,7 @@ static int ti_ads7950_probe(struct spi_device *spi)
634634
st->chip.label = dev_name(&st->spi->dev);
635635
st->chip.parent = &st->spi->dev;
636636
st->chip.owner = THIS_MODULE;
637+
st->chip.can_sleep = true;
637638
st->chip.base = -1;
638639
st->chip.ngpio = TI_ADS7950_NUM_GPIOS;
639640
st->chip.get_direction = ti_ads7950_get_direction;

0 commit comments

Comments
 (0)