mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
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 <[email protected]> [[email protected]: fix build failure] Signed-off-by: Thierry Reding <[email protected]>
This commit is contained in:
parent
e926b12c61
commit
b05232d624
1 changed files with 2 additions and 2 deletions
|
|
@ -226,7 +226,7 @@ static int pwm_samsung_request(struct pwm_chip *chip, struct pwm_device *pwm)
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
our_chan = devm_kzalloc(chip->dev, sizeof(*our_chan), GFP_KERNEL);
|
||||
our_chan = kzalloc(sizeof(*our_chan), GFP_KERNEL);
|
||||
if (!our_chan)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
@ -237,7 +237,7 @@ static int pwm_samsung_request(struct pwm_chip *chip, struct pwm_device *pwm)
|
|||
|
||||
static void pwm_samsung_free(struct pwm_chip *chip, struct pwm_device *pwm)
|
||||
{
|
||||
devm_kfree(chip->dev, pwm_get_chip_data(pwm));
|
||||
kfree(pwm_get_chip_data(pwm));
|
||||
}
|
||||
|
||||
static int pwm_samsung_enable(struct pwm_chip *chip, struct pwm_device *pwm)
|
||||
|
|
|
|||
Loading…
Reference in a new issue