pwm: Reduce time the pwm_lock mutex is held in pwmchip_add()
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Fri, 2 Dec 2022 18:35:10 +0000 (19:35 +0100)
committerThierry Reding <thierry.reding@gmail.com>
Tue, 6 Dec 2022 11:46:06 +0000 (12:46 +0100)
commitc8135b5174145a65c72c4303f2752cc8cecf8d08
tree2976bcd8bf39daa9de5e86e764a37da976b2b3f4
parente51b156b18fb6d34a1e409d153040a02adb5c7e0
pwm: Reduce time the pwm_lock mutex is held in pwmchip_add()

This simplifies error handling as the need for goto error handling goes
away and at the end of the function the code can be simplified as this
code isn't used in the error case any more.

Now memory allocation and the call to of_pwmchip_add() are done without
holding the lock. Both don't access the data structures protected by
&pwm_lock.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20221117211143.3817381-3-u.kleine-koenig@pengutronix.de
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
drivers/pwm/core.c