Skip to content

Commit abeef1f

Browse files
committed
drm/rockchip: stop passing non struct drm_device to drm_err() and friends
The expectation is that the struct drm_device based logging helpers get passed an actual struct drm_device pointer rather than some random struct pointer where you can dereference the ->dev member. Convert drm_err(hdmi, ...) to dev_err(hdmi->dev, ...). This matches current usage, but drops "[drm] *ERROR*" prefix from logging. Reviewed-by: Simona Vetter <[email protected]> Reviewed-by: Louis Chauvet <[email protected]> Signed-off-by: Jani Nikula <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/f42da4c9943a2f2a9de4272b7849e72236d4c3f9.1737644530.git.jani.nikula@intel.com
1 parent 491626f commit abeef1f

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ static int rockchip_hdmi_parse_dt(struct rockchip_hdmi *hdmi)
203203

204204
hdmi->regmap = syscon_regmap_lookup_by_phandle(np, "rockchip,grf");
205205
if (IS_ERR(hdmi->regmap)) {
206-
drm_err(hdmi, "Unable to get rockchip,grf\n");
206+
dev_err(hdmi->dev, "Unable to get rockchip,grf\n");
207207
return PTR_ERR(hdmi->regmap);
208208
}
209209

@@ -214,15 +214,15 @@ static int rockchip_hdmi_parse_dt(struct rockchip_hdmi *hdmi)
214214
if (IS_ERR(hdmi->ref_clk)) {
215215
ret = PTR_ERR(hdmi->ref_clk);
216216
if (ret != -EPROBE_DEFER)
217-
drm_err(hdmi, "failed to get reference clock\n");
217+
dev_err(hdmi->dev, "failed to get reference clock\n");
218218
return ret;
219219
}
220220

221221
hdmi->grf_clk = devm_clk_get_optional(hdmi->dev, "grf");
222222
if (IS_ERR(hdmi->grf_clk)) {
223223
ret = PTR_ERR(hdmi->grf_clk);
224224
if (ret != -EPROBE_DEFER)
225-
drm_err(hdmi, "failed to get grf clock\n");
225+
dev_err(hdmi->dev, "failed to get grf clock\n");
226226
return ret;
227227
}
228228

@@ -302,16 +302,16 @@ static void dw_hdmi_rockchip_encoder_enable(struct drm_encoder *encoder)
302302

303303
ret = clk_prepare_enable(hdmi->grf_clk);
304304
if (ret < 0) {
305-
drm_err(hdmi, "failed to enable grfclk %d\n", ret);
305+
dev_err(hdmi->dev, "failed to enable grfclk %d\n", ret);
306306
return;
307307
}
308308

309309
ret = regmap_write(hdmi->regmap, hdmi->chip_data->lcdsel_grf_reg, val);
310310
if (ret != 0)
311-
drm_err(hdmi, "Could not write to GRF: %d\n", ret);
311+
dev_err(hdmi->dev, "Could not write to GRF: %d\n", ret);
312312

313313
clk_disable_unprepare(hdmi->grf_clk);
314-
drm_dbg(hdmi, "vop %s output to hdmi\n", ret ? "LIT" : "BIG");
314+
dev_dbg(hdmi->dev, "vop %s output to hdmi\n", ret ? "LIT" : "BIG");
315315
}
316316

317317
static int
@@ -574,15 +574,15 @@ static int dw_hdmi_rockchip_bind(struct device *dev, struct device *master,
574574
ret = rockchip_hdmi_parse_dt(hdmi);
575575
if (ret) {
576576
if (ret != -EPROBE_DEFER)
577-
drm_err(hdmi, "Unable to parse OF data\n");
577+
dev_err(hdmi->dev, "Unable to parse OF data\n");
578578
return ret;
579579
}
580580

581581
hdmi->phy = devm_phy_optional_get(dev, "hdmi");
582582
if (IS_ERR(hdmi->phy)) {
583583
ret = PTR_ERR(hdmi->phy);
584584
if (ret != -EPROBE_DEFER)
585-
drm_err(hdmi, "failed to get phy\n");
585+
dev_err(hdmi->dev, "failed to get phy\n");
586586
return ret;
587587
}
588588

drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ static void dw_hdmi_qp_rk3588_hpd_work(struct work_struct *work)
242242
if (drm) {
243243
changed = drm_helper_hpd_irq_event(drm);
244244
if (changed)
245-
drm_dbg(hdmi, "connector status changed\n");
245+
dev_dbg(hdmi->dev, "connector status changed\n");
246246
}
247247
}
248248

@@ -472,7 +472,7 @@ static int dw_hdmi_qp_rockchip_bind(struct device *dev, struct device *master,
472472
}
473473
}
474474
if (hdmi->port_id < 0) {
475-
drm_err(hdmi, "Failed to match HDMI port ID\n");
475+
dev_err(hdmi->dev, "Failed to match HDMI port ID\n");
476476
return hdmi->port_id;
477477
}
478478

@@ -496,36 +496,36 @@ static int dw_hdmi_qp_rockchip_bind(struct device *dev, struct device *master,
496496
hdmi->regmap = syscon_regmap_lookup_by_phandle(dev->of_node,
497497
"rockchip,grf");
498498
if (IS_ERR(hdmi->regmap)) {
499-
drm_err(hdmi, "Unable to get rockchip,grf\n");
499+
dev_err(hdmi->dev, "Unable to get rockchip,grf\n");
500500
return PTR_ERR(hdmi->regmap);
501501
}
502502

503503
hdmi->vo_regmap = syscon_regmap_lookup_by_phandle(dev->of_node,
504504
"rockchip,vo-grf");
505505
if (IS_ERR(hdmi->vo_regmap)) {
506-
drm_err(hdmi, "Unable to get rockchip,vo-grf\n");
506+
dev_err(hdmi->dev, "Unable to get rockchip,vo-grf\n");
507507
return PTR_ERR(hdmi->vo_regmap);
508508
}
509509

510510
ret = devm_clk_bulk_get_all_enabled(hdmi->dev, &clks);
511511
if (ret < 0) {
512-
drm_err(hdmi, "Failed to get clocks: %d\n", ret);
512+
dev_err(hdmi->dev, "Failed to get clocks: %d\n", ret);
513513
return ret;
514514
}
515515

516516
hdmi->enable_gpio = devm_gpiod_get_optional(hdmi->dev, "enable",
517517
GPIOD_OUT_HIGH);
518518
if (IS_ERR(hdmi->enable_gpio)) {
519519
ret = PTR_ERR(hdmi->enable_gpio);
520-
drm_err(hdmi, "Failed to request enable GPIO: %d\n", ret);
520+
dev_err(hdmi->dev, "Failed to request enable GPIO: %d\n", ret);
521521
return ret;
522522
}
523523

524524
hdmi->phy = devm_of_phy_get_by_index(dev, dev->of_node, 0);
525525
if (IS_ERR(hdmi->phy)) {
526526
ret = PTR_ERR(hdmi->phy);
527527
if (ret != -EPROBE_DEFER)
528-
drm_err(hdmi, "failed to get phy: %d\n", ret);
528+
dev_err(hdmi->dev, "failed to get phy: %d\n", ret);
529529
return ret;
530530
}
531531

@@ -564,7 +564,7 @@ static int dw_hdmi_qp_rockchip_bind(struct device *dev, struct device *master,
564564
connector = drm_bridge_connector_init(drm, encoder);
565565
if (IS_ERR(connector)) {
566566
ret = PTR_ERR(connector);
567-
drm_err(hdmi, "failed to init bridge connector: %d\n", ret);
567+
dev_err(hdmi->dev, "failed to init bridge connector: %d\n", ret);
568568
return ret;
569569
}
570570

0 commit comments

Comments
 (0)