diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2019-03-25 05:49:34 -0400 |
---|---|---|
committer | Thierry Reding <thierry.reding@gmail.com> | 2019-05-09 11:29:15 -0400 |
commit | b05232d624425f8584b511f0e102c3b963b00323 (patch) | |
tree | 7228f78a402e751edaebb4d154e80937e7a2b92e /drivers/pwm/pwm-samsung.c | |
parent | e926b12c611c2095c7976e2ed31753ad6eb5ff1a (diff) |
pwm: samsung: Don't uses devm_*() functions in ->request()
A call to ->request() is always paired by a call to ->free() before a
given device is disposed. So the simplification that usually is possible
when using devm_*() functions cannot be used here. So use plain
kzalloc() and kfree() for improved runtime behaviour and reduced memory
footprint.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
[thierry.reding@gmail.com: fix build failure]
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Diffstat (limited to 'drivers/pwm/pwm-samsung.c')
-rw-r--r-- | drivers/pwm/pwm-samsung.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/pwm/pwm-samsung.c b/drivers/pwm/pwm-samsung.c index 3762432dd6a7..6674e1e80175 100644 --- a/drivers/pwm/pwm-samsung.c +++ b/drivers/pwm/pwm-samsung.c | |||
@@ -226,7 +226,7 @@ static int pwm_samsung_request(struct pwm_chip *chip, struct pwm_device *pwm) | |||
226 | return -EINVAL; | 226 | return -EINVAL; |
227 | } | 227 | } |
228 | 228 | ||
229 | our_chan = devm_kzalloc(chip->dev, sizeof(*our_chan), GFP_KERNEL); | 229 | our_chan = kzalloc(sizeof(*our_chan), GFP_KERNEL); |
230 | if (!our_chan) | 230 | if (!our_chan) |
231 | return -ENOMEM; | 231 | return -ENOMEM; |
232 | 232 | ||
@@ -237,7 +237,7 @@ static int pwm_samsung_request(struct pwm_chip *chip, struct pwm_device *pwm) | |||
237 | 237 | ||
238 | static void pwm_samsung_free(struct pwm_chip *chip, struct pwm_device *pwm) | 238 | static void pwm_samsung_free(struct pwm_chip *chip, struct pwm_device *pwm) |
239 | { | 239 | { |
240 | devm_kfree(chip->dev, pwm_get_chip_data(pwm)); | 240 | kfree(pwm_get_chip_data(pwm)); |
241 | } | 241 | } |
242 | 242 | ||
243 | static int pwm_samsung_enable(struct pwm_chip *chip, struct pwm_device *pwm) | 243 | static int pwm_samsung_enable(struct pwm_chip *chip, struct pwm_device *pwm) |