Commit 22f032c7 authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Uwe Kleine-König
Browse files

pwm: axi-pwmgen: Create a dedicated function for getting driver data from a chip



Compared to direct calls to pwmchip_get_drvdata() a dedicated function
has two upsides: A better name and the right type. So the code becomes
easier to read and the new function is harder to use wrongly.

Another side effect (which is the secret motivation for this patch, but
shhh) is that the driver becomes a bit easier to backport to kernel
versions that don't have devm_pwmchip_alloc() yet.

Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@baylibre.com>
Reviewed-by: default avatarTrevor Gamblin <tgamblin@baylibre.com>
Link: https://lore.kernel.org/r/20240923125418.16558-2-u.kleine-koenig@baylibre.com


[ukleinek: added an * to the new function's prototype to make the compiler happy]
Signed-off-by: default avatarUwe Kleine-König <ukleinek@kernel.org>
parent 51f81370
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment