pwm: atmel-tcb: Harmonize resource allocation order
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Wed, 19 Jul 2023 19:20:09 +0000 (21:20 +0200)
committerThierry Reding <thierry.reding@gmail.com>
Fri, 28 Jul 2023 07:34:42 +0000 (09:34 +0200)
commit0323e8fedd1ef25342cf7abf3a2024f5670362b8
treea08eb05d41c65033ab6643e8034824d9b271f271
parent84c33f4278249aecb49375fb884b0b14a3664a63
pwm: atmel-tcb: Harmonize resource allocation order

Allocate driver data as first resource in the probe function. This way it
can be used during allocation of the other resources (instead of assigning
these to local variables first and update driver data only when it's
allocated). Also as driver data is allocated using a devm function this
should happen first to have the order of freeing resources in the error
path and the remove function in reverse.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
drivers/pwm/pwm-atmel-tcb.c