In the expression determining the size of the allocation for chip->pwms
it's more natural to use sizeof(*chip->pwms) than sizeof(*pwm). With
that changed, the variable pwm is only used in a for loop and its scope
can be reduced accordingly.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
  */
 int __pwmchip_add(struct pwm_chip *chip, struct module *owner)
 {
-       struct pwm_device *pwm;
        unsigned int i;
        int ret;
 
 
        chip->owner = owner;
 
-       chip->pwms = kcalloc(chip->npwm, sizeof(*pwm), GFP_KERNEL);
+       chip->pwms = kcalloc(chip->npwm, sizeof(*chip->pwms), GFP_KERNEL);
        if (!chip->pwms)
                return -ENOMEM;
 
        chip->id = ret;
 
        for (i = 0; i < chip->npwm; i++) {
-               pwm = &chip->pwms[i];
+               struct pwm_device *pwm = &chip->pwms[i];
 
                pwm->chip = chip;
                pwm->hwpwm = i;