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

drm/panel: sitronix: Use dev_ based logging

Standardize on the dev_ based logging and drop the include of drm_print.h.
Fix a few cases where "x@" was used when printing the mode.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Guido Günther <agx@sigxcpu.org>
Cc: Jagan Teki <jagan@amarulasolutions.com>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Guido Günther <agx@sigxcpu.org>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200815125406.1153224-5-sam@ravnborg.org

+27 -44
+4 -6
drivers/gpu/drm/panel/panel-sitronix-st7701.c
··· 7 7 #include <drm/drm_mipi_dsi.h> 8 8 #include <drm/drm_modes.h> 9 9 #include <drm/drm_panel.h> 10 - #include <drm/drm_print.h> 11 10 12 11 #include <linux/gpio/consumer.h> 13 12 #include <linux/delay.h> ··· 268 269 269 270 mode = drm_mode_duplicate(connector->dev, desc_mode); 270 271 if (!mode) { 271 - DRM_DEV_ERROR(&st7701->dsi->dev, 272 - "failed to add mode %ux%ux@%u\n", 273 - desc_mode->hdisplay, desc_mode->vdisplay, 274 - drm_mode_vrefresh(desc_mode)); 272 + dev_err(&st7701->dsi->dev, "failed to add mode %ux%u@%u\n", 273 + desc_mode->hdisplay, desc_mode->vdisplay, 274 + drm_mode_vrefresh(desc_mode)); 275 275 return -ENOMEM; 276 276 } 277 277 ··· 356 358 357 359 st7701->reset = devm_gpiod_get(&dsi->dev, "reset", GPIOD_OUT_LOW); 358 360 if (IS_ERR(st7701->reset)) { 359 - DRM_DEV_ERROR(&dsi->dev, "Couldn't get our reset GPIO\n"); 361 + dev_err(&dsi->dev, "Couldn't get our reset GPIO\n"); 360 362 return PTR_ERR(st7701->reset); 361 363 } 362 364
+23 -38
drivers/gpu/drm/panel/panel-sitronix-st7703.c
··· 22 22 #include <drm/drm_mipi_dsi.h> 23 23 #include <drm/drm_modes.h> 24 24 #include <drm/drm_panel.h> 25 - #include <drm/drm_print.h> 26 25 27 26 #define DRV_NAME "panel-sitronix-st7703" 28 27 ··· 363 364 364 365 ret = ctx->desc->init_sequence(ctx); 365 366 if (ret < 0) { 366 - DRM_DEV_ERROR(ctx->dev, "Panel init sequence failed: %d\n", 367 - ret); 367 + dev_err(ctx->dev, "Panel init sequence failed: %d\n", ret); 368 368 return ret; 369 369 } 370 370 ··· 371 373 372 374 ret = mipi_dsi_dcs_exit_sleep_mode(dsi); 373 375 if (ret < 0) { 374 - DRM_DEV_ERROR(ctx->dev, "Failed to exit sleep mode: %d\n", ret); 376 + dev_err(ctx->dev, "Failed to exit sleep mode: %d\n", ret); 375 377 return ret; 376 378 } 377 379 ··· 382 384 if (ret) 383 385 return ret; 384 386 385 - DRM_DEV_DEBUG_DRIVER(ctx->dev, "Panel init sequence done\n"); 387 + dev_dbg(ctx->dev, "Panel init sequence done\n"); 386 388 387 389 return 0; 388 390 } ··· 395 397 396 398 ret = mipi_dsi_dcs_set_display_off(dsi); 397 399 if (ret < 0) 398 - DRM_DEV_ERROR(ctx->dev, 399 - "Failed to turn off the display: %d\n", ret); 400 + dev_err(ctx->dev, "Failed to turn off the display: %d\n", ret); 400 401 401 402 ret = mipi_dsi_dcs_enter_sleep_mode(dsi); 402 403 if (ret < 0) 403 - DRM_DEV_ERROR(ctx->dev, 404 - "Failed to enter sleep mode: %d\n", ret); 404 + dev_err(ctx->dev, "Failed to enter sleep mode: %d\n", ret); 405 405 406 406 return 0; 407 407 } ··· 427 431 if (ctx->prepared) 428 432 return 0; 429 433 430 - DRM_DEV_DEBUG_DRIVER(ctx->dev, "Resetting the panel\n"); 434 + dev_dbg(ctx->dev, "Resetting the panel\n"); 431 435 ret = regulator_enable(ctx->vcc); 432 436 if (ret < 0) { 433 - DRM_DEV_ERROR(ctx->dev, 434 - "Failed to enable vcc supply: %d\n", ret); 437 + dev_err(ctx->dev, "Failed to enable vcc supply: %d\n", ret); 435 438 return ret; 436 439 } 437 440 ret = regulator_enable(ctx->iovcc); 438 441 if (ret < 0) { 439 - DRM_DEV_ERROR(ctx->dev, 440 - "Failed to enable iovcc supply: %d\n", ret); 442 + dev_err(ctx->dev, "Failed to enable iovcc supply: %d\n", ret); 441 443 goto disable_vcc; 442 444 } 443 445 ··· 461 467 462 468 mode = drm_mode_duplicate(connector->dev, ctx->desc->mode); 463 469 if (!mode) { 464 - DRM_DEV_ERROR(ctx->dev, "Failed to add mode %ux%u@%u\n", 465 - ctx->desc->mode->hdisplay, ctx->desc->mode->vdisplay, 466 - drm_mode_vrefresh(ctx->desc->mode)); 470 + dev_err(ctx->dev, "Failed to add mode %ux%u@%u\n", 471 + ctx->desc->mode->hdisplay, ctx->desc->mode->vdisplay, 472 + drm_mode_vrefresh(ctx->desc->mode)); 467 473 return -ENOMEM; 468 474 } 469 475 ··· 490 496 struct st7703 *ctx = data; 491 497 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); 492 498 493 - DRM_DEV_DEBUG_DRIVER(ctx->dev, "Setting all pixels on\n"); 499 + dev_dbg(ctx->dev, "Setting all pixels on\n"); 494 500 dsi_generic_write_seq(dsi, ST7703_CMD_ALL_PIXEL_ON); 495 501 msleep(val * 1000); 496 502 /* Reset the panel to get video back */ ··· 531 537 532 538 ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW); 533 539 if (IS_ERR(ctx->reset_gpio)) { 534 - DRM_DEV_ERROR(dev, "cannot get reset gpio\n"); 540 + dev_err(dev, "cannot get reset gpio\n"); 535 541 return PTR_ERR(ctx->reset_gpio); 536 542 } 537 543 ··· 548 554 if (IS_ERR(ctx->vcc)) { 549 555 ret = PTR_ERR(ctx->vcc); 550 556 if (ret != -EPROBE_DEFER) 551 - DRM_DEV_ERROR(dev, 552 - "Failed to request vcc regulator: %d\n", 553 - ret); 557 + dev_err(dev, "Failed to request vcc regulator: %d\n", ret); 554 558 return ret; 555 559 } 556 560 ctx->iovcc = devm_regulator_get(dev, "iovcc"); 557 561 if (IS_ERR(ctx->iovcc)) { 558 562 ret = PTR_ERR(ctx->iovcc); 559 563 if (ret != -EPROBE_DEFER) 560 - DRM_DEV_ERROR(dev, 561 - "Failed to request iovcc regulator: %d\n", 562 - ret); 564 + dev_err(dev, "Failed to request iovcc regulator: %d\n", ret); 563 565 return ret; 564 566 } 565 567 ··· 570 580 571 581 ret = mipi_dsi_attach(dsi); 572 582 if (ret < 0) { 573 - DRM_DEV_ERROR(dev, 574 - "mipi_dsi_attach failed (%d). Is host ready?\n", 575 - ret); 583 + dev_err(dev, "mipi_dsi_attach failed (%d). Is host ready?\n", ret); 576 584 drm_panel_remove(&ctx->panel); 577 585 return ret; 578 586 } 579 587 580 - DRM_DEV_INFO(dev, "%ux%u@%u %ubpp dsi %udl - ready\n", 581 - ctx->desc->mode->hdisplay, ctx->desc->mode->vdisplay, 582 - drm_mode_vrefresh(ctx->desc->mode), 583 - mipi_dsi_pixel_format_to_bpp(dsi->format), dsi->lanes); 588 + dev_info(dev, "%ux%u@%u %ubpp dsi %udl - ready\n", 589 + ctx->desc->mode->hdisplay, ctx->desc->mode->vdisplay, 590 + drm_mode_vrefresh(ctx->desc->mode), 591 + mipi_dsi_pixel_format_to_bpp(dsi->format), dsi->lanes); 584 592 585 593 st7703_debugfs_init(ctx); 586 594 return 0; ··· 591 603 592 604 ret = drm_panel_unprepare(&ctx->panel); 593 605 if (ret < 0) 594 - DRM_DEV_ERROR(&dsi->dev, "Failed to unprepare panel: %d\n", 595 - ret); 606 + dev_err(&dsi->dev, "Failed to unprepare panel: %d\n", ret); 596 607 597 608 ret = drm_panel_disable(&ctx->panel); 598 609 if (ret < 0) 599 - DRM_DEV_ERROR(&dsi->dev, "Failed to disable panel: %d\n", 600 - ret); 610 + dev_err(&dsi->dev, "Failed to disable panel: %d\n", ret); 601 611 } 602 612 603 613 static int st7703_remove(struct mipi_dsi_device *dsi) ··· 607 621 608 622 ret = mipi_dsi_detach(dsi); 609 623 if (ret < 0) 610 - DRM_DEV_ERROR(&dsi->dev, "Failed to detach from DSI host: %d\n", 611 - ret); 624 + dev_err(&dsi->dev, "Failed to detach from DSI host: %d\n", ret); 612 625 613 626 drm_panel_remove(&ctx->panel); 614 627