Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

pwm: Use a consistent name for pwm_chip pointers in the core

Most variables of type struct pwm_chip * are named "chip", there are
only three outliers called "pc". Change these three to "chip", too, for
consistency.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>

authored by

Uwe Kleine-König and committed by
Thierry Reding
b4f78ff7 06c2afb8

+17 -17
+14 -14
drivers/pwm/core.c
··· 127 127 } 128 128 129 129 struct pwm_device * 130 - of_pwm_xlate_with_flags(struct pwm_chip *pc, const struct of_phandle_args *args) 130 + of_pwm_xlate_with_flags(struct pwm_chip *chip, const struct of_phandle_args *args) 131 131 { 132 132 struct pwm_device *pwm; 133 133 134 - if (pc->of_pwm_n_cells < 2) 134 + if (chip->of_pwm_n_cells < 2) 135 135 return ERR_PTR(-EINVAL); 136 136 137 137 /* flags in the third cell are optional */ 138 138 if (args->args_count < 2) 139 139 return ERR_PTR(-EINVAL); 140 140 141 - if (args->args[0] >= pc->npwm) 141 + if (args->args[0] >= chip->npwm) 142 142 return ERR_PTR(-EINVAL); 143 143 144 - pwm = pwm_request_from_chip(pc, args->args[0], NULL); 144 + pwm = pwm_request_from_chip(chip, args->args[0], NULL); 145 145 if (IS_ERR(pwm)) 146 146 return pwm; 147 147 148 148 pwm->args.period = args->args[1]; 149 149 pwm->args.polarity = PWM_POLARITY_NORMAL; 150 150 151 - if (pc->of_pwm_n_cells >= 3) { 151 + if (chip->of_pwm_n_cells >= 3) { 152 152 if (args->args_count > 2 && args->args[2] & PWM_POLARITY_INVERTED) 153 153 pwm->args.polarity = PWM_POLARITY_INVERSED; 154 154 } ··· 158 158 EXPORT_SYMBOL_GPL(of_pwm_xlate_with_flags); 159 159 160 160 struct pwm_device * 161 - of_pwm_single_xlate(struct pwm_chip *pc, const struct of_phandle_args *args) 161 + of_pwm_single_xlate(struct pwm_chip *chip, const struct of_phandle_args *args) 162 162 { 163 163 struct pwm_device *pwm; 164 164 165 - if (pc->of_pwm_n_cells < 1) 165 + if (chip->of_pwm_n_cells < 1) 166 166 return ERR_PTR(-EINVAL); 167 167 168 168 /* validate that one cell is specified, optionally with flags */ 169 169 if (args->args_count != 1 && args->args_count != 2) 170 170 return ERR_PTR(-EINVAL); 171 171 172 - pwm = pwm_request_from_chip(pc, 0, NULL); 172 + pwm = pwm_request_from_chip(chip, 0, NULL); 173 173 if (IS_ERR(pwm)) 174 174 return pwm; 175 175 ··· 692 692 struct pwm_device *pwm = NULL; 693 693 struct of_phandle_args args; 694 694 struct device_link *dl; 695 - struct pwm_chip *pc; 695 + struct pwm_chip *chip; 696 696 int index = 0; 697 697 int err; 698 698 ··· 709 709 return ERR_PTR(err); 710 710 } 711 711 712 - pc = fwnode_to_pwmchip(of_fwnode_handle(args.np)); 713 - if (IS_ERR(pc)) { 714 - if (PTR_ERR(pc) != -EPROBE_DEFER) 712 + chip = fwnode_to_pwmchip(of_fwnode_handle(args.np)); 713 + if (IS_ERR(chip)) { 714 + if (PTR_ERR(chip) != -EPROBE_DEFER) 715 715 pr_err("%s(): PWM chip not found\n", __func__); 716 716 717 - pwm = ERR_CAST(pc); 717 + pwm = ERR_CAST(chip); 718 718 goto put; 719 719 } 720 720 721 - pwm = pc->of_xlate(pc, &args); 721 + pwm = chip->of_xlate(chip, &args); 722 722 if (IS_ERR(pwm)) 723 723 goto put; 724 724
+3 -3
include/linux/pwm.h
··· 298 298 int base; 299 299 unsigned int npwm; 300 300 301 - struct pwm_device * (*of_xlate)(struct pwm_chip *pc, 301 + struct pwm_device * (*of_xlate)(struct pwm_chip *chip, 302 302 const struct of_phandle_args *args); 303 303 unsigned int of_pwm_n_cells; 304 304 ··· 395 395 unsigned int index, 396 396 const char *label); 397 397 398 - struct pwm_device *of_pwm_xlate_with_flags(struct pwm_chip *pc, 398 + struct pwm_device *of_pwm_xlate_with_flags(struct pwm_chip *chip, 399 399 const struct of_phandle_args *args); 400 - struct pwm_device *of_pwm_single_xlate(struct pwm_chip *pc, 400 + struct pwm_device *of_pwm_single_xlate(struct pwm_chip *chip, 401 401 const struct of_phandle_args *args); 402 402 403 403 struct pwm_device *pwm_get(struct device *dev, const char *con_id);