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

Configure Feed

Select the types of activity you want to include in your feed.

pwm: vt8500: Rename variable pointing to driver private data

Status quo is that variables of type struct vt8500_chip * are named
"vt8500", "chip". Because usually only struct pwm_device * variables
are named "pwm" and "chip" is usually used for variabled of type
struct pwm_chip *.

So consistently use the same and non-conflicting name "vt8500".

Signed-off-by: zhaoxiao <zhaoxiao@uniontech.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>

authored by

zhaoxiao and committed by
Thierry Reding
635d324e 4f34ebbe

+19 -19
+19 -19
drivers/pwm/pwm-vt8500.c
··· 235 235 236 236 static int vt8500_pwm_probe(struct platform_device *pdev) 237 237 { 238 - struct vt8500_chip *chip; 238 + struct vt8500_chip *vt8500; 239 239 struct device_node *np = pdev->dev.of_node; 240 240 int ret; 241 241 ··· 244 244 return -EINVAL; 245 245 } 246 246 247 - chip = devm_kzalloc(&pdev->dev, sizeof(*chip), GFP_KERNEL); 248 - if (chip == NULL) 247 + vt8500 = devm_kzalloc(&pdev->dev, sizeof(*vt8500), GFP_KERNEL); 248 + if (vt8500 == NULL) 249 249 return -ENOMEM; 250 250 251 - chip->chip.dev = &pdev->dev; 252 - chip->chip.ops = &vt8500_pwm_ops; 253 - chip->chip.npwm = VT8500_NR_PWMS; 251 + vt8500->chip.dev = &pdev->dev; 252 + vt8500->chip.ops = &vt8500_pwm_ops; 253 + vt8500->chip.npwm = VT8500_NR_PWMS; 254 254 255 - chip->clk = devm_clk_get(&pdev->dev, NULL); 256 - if (IS_ERR(chip->clk)) { 255 + vt8500->clk = devm_clk_get(&pdev->dev, NULL); 256 + if (IS_ERR(vt8500->clk)) { 257 257 dev_err(&pdev->dev, "clock source not specified\n"); 258 - return PTR_ERR(chip->clk); 258 + return PTR_ERR(vt8500->clk); 259 259 } 260 260 261 - chip->base = devm_platform_ioremap_resource(pdev, 0); 262 - if (IS_ERR(chip->base)) 263 - return PTR_ERR(chip->base); 261 + vt8500->base = devm_platform_ioremap_resource(pdev, 0); 262 + if (IS_ERR(vt8500->base)) 263 + return PTR_ERR(vt8500->base); 264 264 265 - ret = clk_prepare(chip->clk); 265 + ret = clk_prepare(vt8500->clk); 266 266 if (ret < 0) { 267 267 dev_err(&pdev->dev, "failed to prepare clock\n"); 268 268 return ret; 269 269 } 270 270 271 - ret = pwmchip_add(&chip->chip); 271 + ret = pwmchip_add(&vt8500->chip); 272 272 if (ret < 0) { 273 273 dev_err(&pdev->dev, "failed to add PWM chip\n"); 274 - clk_unprepare(chip->clk); 274 + clk_unprepare(vt8500->clk); 275 275 return ret; 276 276 } 277 277 278 - platform_set_drvdata(pdev, chip); 278 + platform_set_drvdata(pdev, vt8500); 279 279 return ret; 280 280 } 281 281 282 282 static int vt8500_pwm_remove(struct platform_device *pdev) 283 283 { 284 - struct vt8500_chip *chip = platform_get_drvdata(pdev); 284 + struct vt8500_chip *vt8500 = platform_get_drvdata(pdev); 285 285 286 - pwmchip_remove(&chip->chip); 286 + pwmchip_remove(&vt8500->chip); 287 287 288 - clk_unprepare(chip->clk); 288 + clk_unprepare(vt8500->clk); 289 289 290 290 return 0; 291 291 }