]> www.infradead.org Git - users/jedix/linux-maple.git/commit
iio: light: al3010: Fix an error handling path in al3010_probe()
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Tue, 10 Sep 2024 18:36:06 +0000 (20:36 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 30 Sep 2024 08:21:03 +0000 (09:21 +0100)
commita4b7064d34186cf4970fe0333c3b27346cf8f819
treeb4877af7986fcd1e10a194323601cdc783ed3099
parent762186c6e7b1dab5af1b8aa46fa0a3b1a9aaafde
iio: light: al3010: Fix an error handling path in al3010_probe()

If i2c_smbus_write_byte_data() fails in al3010_init(),
al3010_set_pwr(false) is not called.

In order to avoid such a situation, move the devm_add_action_or_reset()
witch calls al3010_set_pwr(false) right after a successful
al3010_set_pwr(true).

Fixes: c36b5195ab70 ("iio: light: add Dyna-Image AL3010 driver")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://patch.msgid.link/ee5d10a2dd2b70f29772d5df33774d3974a80f30.1725993353.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/light/al3010.c