Commit 6b2bb1a1 authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Greg Kroah-Hartman
Browse files

pwm: atmel-tcb: Harmonize resource allocation order



[ Upstream commit 0323e8fe ]

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: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
Stable-dep-of: c1162232 ("pwm: atmel-tcb: Fix resource freeing in error path and remove")
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent d4734ef7
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment