]> git.baikalelectronics.ru Git - kernel.git/commit
rtc: stmp3xxx: Add failure handling for stmp3xxx_wdt_register()
authorLin Yujun <linyujun809@huawei.com>
Thu, 15 Sep 2022 06:52:53 +0000 (14:52 +0800)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Wed, 12 Oct 2022 22:03:11 +0000 (00:03 +0200)
commite1bd3ab45d0558ec5c25524482501b3e4a1b972f
treee6e62188ceee59c005b208ecff30ca73584d924a
parent5a57693c6d8022041e7ff04abfdc5cfdeb26169c
rtc: stmp3xxx: Add failure handling for stmp3xxx_wdt_register()

Use platform_device_put() to free platform device before print
error message when platform_device_add() fails to run.

Fixes: 20780086caf0 ("rtc: stmp3xxx: add wdt-accessor function")
Signed-off-by: Lin Yujun <linyujun809@huawei.com>
Reviewed-by: Wolfram Sang <wsa@kernel.org>
Link: https://lore.kernel.org/r/20220915065253.43668-1-linyujun809@huawei.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/rtc/rtc-stmp3xxx.c