diff options
author | Sumitra Sharma <sumitraartsy@gmail.com> | 2023-03-25 23:45:19 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-03-26 08:56:37 +0200 |
commit | b07c8ef8c60a4714fad3d7c95a8e464ad83ca715 (patch) | |
tree | 0873c81907715b286ccfcec7ca640bfb1cb5820d /drivers/staging/greybus | |
parent | 91de7cdc784f28655eb97de3e66ede0ada94b6eb (diff) |
staging: greybus: Inline pwm_chip_to_gb_pwm_chip()
Convert 'pwm_chip_to_gb_pwm_chip' from a macro to a static
inline function, to make the relevant types apparent in the
definition and to benefit from the type checking performed by
the compiler at call sites.
Signed-off-by: Sumitra Sharma <sumitraartsy@gmail.com>
Link: https://lore.kernel.org/r/20230326064519.GA179449@sumitra.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/greybus')
-rw-r--r-- | drivers/staging/greybus/pwm.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/staging/greybus/pwm.c b/drivers/staging/greybus/pwm.c index 26d39e08c3b6..88da1d796f13 100644 --- a/drivers/staging/greybus/pwm.c +++ b/drivers/staging/greybus/pwm.c @@ -21,8 +21,11 @@ struct gb_pwm_chip { struct pwm_chip chip; struct pwm_chip *pwm; }; -#define pwm_chip_to_gb_pwm_chip(chip) \ - container_of(chip, struct gb_pwm_chip, chip) + +static inline struct gb_pwm_chip *pwm_chip_to_gb_pwm_chip(struct pwm_chip *chip) +{ + return container_of(chip, struct gb_pwm_chip, chip); +} static int gb_pwm_count_operation(struct gb_pwm_chip *pwmc) { |