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.

drm/msm/hdmi: Simplify with local 'dev' variable

msm_hdmi_dev_probe() function already stores pdev->dev in local
variable, so use it directly to make code simpler.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Patchwork: https://patchwork.freedesktop.org/patch/711171/
Link: https://lore.kernel.org/r/20260311-drm-msm-hdmi-cleanup-v1-3-c5535245f6de@oss.qualcomm.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>

authored by

Krzysztof Kozlowski and committed by
Dmitry Baryshkov
69c68ab3 ae505afd

+10 -12
+10 -12
drivers/gpu/drm/msm/hdmi/hdmi.c
··· 278 278 if (!config) 279 279 return -EINVAL; 280 280 281 - hdmi = devm_kzalloc(&pdev->dev, sizeof(*hdmi), GFP_KERNEL); 281 + hdmi = devm_kzalloc(dev, sizeof(*hdmi), GFP_KERNEL); 282 282 if (!hdmi) 283 283 return -ENOMEM; 284 284 ··· 304 304 305 305 hdmi->qfprom_mmio = msm_ioremap(pdev, "qfprom_physical"); 306 306 if (IS_ERR(hdmi->qfprom_mmio)) { 307 - DRM_DEV_INFO(&pdev->dev, "can't find qfprom resource\n"); 307 + DRM_DEV_INFO(dev, "can't find qfprom resource\n"); 308 308 hdmi->qfprom_mmio = NULL; 309 309 } 310 310 ··· 312 312 if (hdmi->irq < 0) 313 313 return hdmi->irq; 314 314 315 - hdmi->pwr_regs = devm_kcalloc(&pdev->dev, 316 - config->pwr_reg_cnt, 315 + hdmi->pwr_regs = devm_kcalloc(dev, config->pwr_reg_cnt, 317 316 sizeof(hdmi->pwr_regs[0]), 318 317 GFP_KERNEL); 319 318 if (!hdmi->pwr_regs) ··· 321 322 for (i = 0; i < config->pwr_reg_cnt; i++) 322 323 hdmi->pwr_regs[i].supply = config->pwr_reg_names[i]; 323 324 324 - ret = devm_regulator_bulk_get(&pdev->dev, config->pwr_reg_cnt, hdmi->pwr_regs); 325 + ret = devm_regulator_bulk_get(dev, config->pwr_reg_cnt, hdmi->pwr_regs); 325 326 if (ret) 326 327 return dev_err_probe(dev, ret, "failed to get pwr regulators\n"); 327 328 328 - hdmi->pwr_clks = devm_kcalloc(&pdev->dev, 329 - config->pwr_clk_cnt, 329 + hdmi->pwr_clks = devm_kcalloc(dev, config->pwr_clk_cnt, 330 330 sizeof(hdmi->pwr_clks[0]), 331 331 GFP_KERNEL); 332 332 if (!hdmi->pwr_clks) ··· 334 336 for (i = 0; i < config->pwr_clk_cnt; i++) 335 337 hdmi->pwr_clks[i].id = config->pwr_clk_names[i]; 336 338 337 - ret = devm_clk_bulk_get(&pdev->dev, config->pwr_clk_cnt, hdmi->pwr_clks); 339 + ret = devm_clk_bulk_get(dev, config->pwr_clk_cnt, hdmi->pwr_clks); 338 340 if (ret) 339 341 return ret; 340 342 341 - hdmi->extp_clk = devm_clk_get_optional(&pdev->dev, "extp"); 343 + hdmi->extp_clk = devm_clk_get_optional(dev, "extp"); 342 344 if (IS_ERR(hdmi->extp_clk)) 343 345 return dev_err_probe(dev, PTR_ERR(hdmi->extp_clk), 344 346 "failed to get extp clock\n"); 345 347 346 - hdmi->hpd_gpiod = devm_gpiod_get_optional(&pdev->dev, "hpd", GPIOD_IN); 348 + hdmi->hpd_gpiod = devm_gpiod_get_optional(dev, "hpd", GPIOD_IN); 347 349 /* This will catch e.g. -EPROBE_DEFER */ 348 350 if (IS_ERR(hdmi->hpd_gpiod)) 349 351 return dev_err_probe(dev, PTR_ERR(hdmi->hpd_gpiod), ··· 359 361 if (ret) 360 362 return ret; 361 363 362 - ret = devm_pm_runtime_enable(&pdev->dev); 364 + ret = devm_pm_runtime_enable(dev); 363 365 if (ret) 364 366 goto err_put_phy; 365 367 366 368 platform_set_drvdata(pdev, hdmi); 367 369 368 - ret = component_add(&pdev->dev, &msm_hdmi_ops); 370 + ret = component_add(dev, &msm_hdmi_ops); 369 371 if (ret) 370 372 goto err_put_phy; 371 373