Commit 59ac702a authored by Stefan Wahren's avatar Stefan Wahren Committed by Maíra Canal

drm/vc4: Get the rid of DRM_ERROR()

DRM_ERROR() has been deprecated in favor of pr_err(). However, we
should prefer to use drm_err() whenever possible so we get device-
specific output with the error message. In error case of kcalloc,
we can simply drop DRM_ERROR(), because kcalloc already logs errors.
Suggested-by: default avatarMaíra Canal <mcanal@igalia.com>
Signed-off-by: default avatarStefan Wahren <wahrenst@gmx.net>
Reviewed-by: default avatarMaxime Ripard <mripard@kernel.org>
Reviewed-by: default avatarMaíra Canal <mcanal@igalia.com>
Signed-off-by: default avatarMaíra Canal <mcanal@igalia.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240821214052.6800-4-wahrenst@gmx.net
parent f1a54e86
...@@ -469,7 +469,7 @@ struct vc4_bo *vc4_bo_create(struct drm_device *dev, size_t unaligned_size, ...@@ -469,7 +469,7 @@ struct vc4_bo *vc4_bo_create(struct drm_device *dev, size_t unaligned_size,
if (IS_ERR(dma_obj)) { if (IS_ERR(dma_obj)) {
struct drm_printer p = drm_info_printer(vc4->base.dev); struct drm_printer p = drm_info_printer(vc4->base.dev);
DRM_ERROR("Failed to allocate from GEM DMA helper:\n"); drm_err(dev, "Failed to allocate from GEM DMA helper:\n");
vc4_bo_stats_print(&p, vc4); vc4_bo_stats_print(&p, vc4);
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
} }
...@@ -702,7 +702,7 @@ static struct dma_buf *vc4_prime_export(struct drm_gem_object *obj, int flags) ...@@ -702,7 +702,7 @@ static struct dma_buf *vc4_prime_export(struct drm_gem_object *obj, int flags)
*/ */
ret = vc4_bo_inc_usecnt(bo); ret = vc4_bo_inc_usecnt(bo);
if (ret) { if (ret) {
DRM_ERROR("Failed to increment BO usecnt\n"); drm_err(obj->dev, "Failed to increment BO usecnt\n");
return ERR_PTR(ret); return ERR_PTR(ret);
} }
...@@ -1050,7 +1050,7 @@ static void vc4_bo_cache_destroy(struct drm_device *dev, void *unused) ...@@ -1050,7 +1050,7 @@ static void vc4_bo_cache_destroy(struct drm_device *dev, void *unused)
for (i = 0; i < vc4->num_labels; i++) { for (i = 0; i < vc4->num_labels; i++) {
if (vc4->bo_labels[i].num_allocated) { if (vc4->bo_labels[i].num_allocated) {
DRM_ERROR("Destroying BO cache with %d %s " drm_err(dev, "Destroying BO cache with %d %s "
"BOs still allocated\n", "BOs still allocated\n",
vc4->bo_labels[i].num_allocated, vc4->bo_labels[i].num_allocated,
vc4->bo_labels[i].name); vc4->bo_labels[i].name);
...@@ -1083,7 +1083,7 @@ int vc4_label_bo_ioctl(struct drm_device *dev, void *data, ...@@ -1083,7 +1083,7 @@ int vc4_label_bo_ioctl(struct drm_device *dev, void *data,
gem_obj = drm_gem_object_lookup(file_priv, args->handle); gem_obj = drm_gem_object_lookup(file_priv, args->handle);
if (!gem_obj) { if (!gem_obj) {
DRM_ERROR("Failed to look up GEM BO %d\n", args->handle); drm_err(dev, "Failed to look up GEM BO %d\n", args->handle);
kfree(name); kfree(name);
return -ENOENT; return -ENOENT;
} }
......
...@@ -199,7 +199,7 @@ static void vc4_dpi_encoder_enable(struct drm_encoder *encoder) ...@@ -199,7 +199,7 @@ static void vc4_dpi_encoder_enable(struct drm_encoder *encoder)
DPI_FORMAT); DPI_FORMAT);
break; break;
default: default:
DRM_ERROR("Unknown media bus format %d\n", drm_err(dev, "Unknown media bus format %d\n",
bus_format); bus_format);
break; break;
} }
...@@ -236,11 +236,11 @@ static void vc4_dpi_encoder_enable(struct drm_encoder *encoder) ...@@ -236,11 +236,11 @@ static void vc4_dpi_encoder_enable(struct drm_encoder *encoder)
ret = clk_set_rate(dpi->pixel_clock, mode->clock * 1000); ret = clk_set_rate(dpi->pixel_clock, mode->clock * 1000);
if (ret) if (ret)
DRM_ERROR("Failed to set clock rate: %d\n", ret); drm_err(dev, "Failed to set clock rate: %d\n", ret);
ret = clk_prepare_enable(dpi->pixel_clock); ret = clk_prepare_enable(dpi->pixel_clock);
if (ret) if (ret)
DRM_ERROR("Failed to set clock rate: %d\n", ret); drm_err(dev, "Failed to set clock rate: %d\n", ret);
drm_dev_exit(idx); drm_dev_exit(idx);
} }
...@@ -339,7 +339,7 @@ static int vc4_dpi_bind(struct device *dev, struct device *master, void *data) ...@@ -339,7 +339,7 @@ static int vc4_dpi_bind(struct device *dev, struct device *master, void *data)
if (IS_ERR(dpi->core_clock)) { if (IS_ERR(dpi->core_clock)) {
ret = PTR_ERR(dpi->core_clock); ret = PTR_ERR(dpi->core_clock);
if (ret != -EPROBE_DEFER) if (ret != -EPROBE_DEFER)
DRM_ERROR("Failed to get core clock: %d\n", ret); drm_err(drm, "Failed to get core clock: %d\n", ret);
return ret; return ret;
} }
...@@ -347,13 +347,13 @@ static int vc4_dpi_bind(struct device *dev, struct device *master, void *data) ...@@ -347,13 +347,13 @@ static int vc4_dpi_bind(struct device *dev, struct device *master, void *data)
if (IS_ERR(dpi->pixel_clock)) { if (IS_ERR(dpi->pixel_clock)) {
ret = PTR_ERR(dpi->pixel_clock); ret = PTR_ERR(dpi->pixel_clock);
if (ret != -EPROBE_DEFER) if (ret != -EPROBE_DEFER)
DRM_ERROR("Failed to get pixel clock: %d\n", ret); drm_err(drm, "Failed to get pixel clock: %d\n", ret);
return ret; return ret;
} }
ret = clk_prepare_enable(dpi->core_clock); ret = clk_prepare_enable(dpi->core_clock);
if (ret) { if (ret) {
DRM_ERROR("Failed to turn on core clock: %d\n", ret); drm_err(drm, "Failed to turn on core clock: %d\n", ret);
return ret; return ret;
} }
......
...@@ -613,6 +613,7 @@ struct vc4_dsi { ...@@ -613,6 +613,7 @@ struct vc4_dsi {
static inline void static inline void
dsi_dma_workaround_write(struct vc4_dsi *dsi, u32 offset, u32 val) dsi_dma_workaround_write(struct vc4_dsi *dsi, u32 offset, u32 val)
{ {
struct drm_device *drm = dsi->bridge.dev;
struct dma_chan *chan = dsi->reg_dma_chan; struct dma_chan *chan = dsi->reg_dma_chan;
struct dma_async_tx_descriptor *tx; struct dma_async_tx_descriptor *tx;
dma_cookie_t cookie; dma_cookie_t cookie;
...@@ -633,19 +634,19 @@ dsi_dma_workaround_write(struct vc4_dsi *dsi, u32 offset, u32 val) ...@@ -633,19 +634,19 @@ dsi_dma_workaround_write(struct vc4_dsi *dsi, u32 offset, u32 val)
dsi->reg_dma_paddr, dsi->reg_dma_paddr,
4, 0); 4, 0);
if (!tx) { if (!tx) {
DRM_ERROR("Failed to set up DMA register write\n"); drm_err(drm, "Failed to set up DMA register write\n");
return; return;
} }
cookie = tx->tx_submit(tx); cookie = tx->tx_submit(tx);
ret = dma_submit_error(cookie); ret = dma_submit_error(cookie);
if (ret) { if (ret) {
DRM_ERROR("Failed to submit DMA: %d\n", ret); drm_err(drm, "Failed to submit DMA: %d\n", ret);
return; return;
} }
ret = dma_sync_wait(chan, cookie); ret = dma_sync_wait(chan, cookie);
if (ret) if (ret)
DRM_ERROR("Failed to wait for DMA: %d\n", ret); drm_err(drm, "Failed to wait for DMA: %d\n", ret);
} }
#define DSI_READ(offset) \ #define DSI_READ(offset) \
...@@ -893,7 +894,7 @@ static void vc4_dsi_bridge_pre_enable(struct drm_bridge *bridge, ...@@ -893,7 +894,7 @@ static void vc4_dsi_bridge_pre_enable(struct drm_bridge *bridge,
ret = pm_runtime_resume_and_get(dev); ret = pm_runtime_resume_and_get(dev);
if (ret) { if (ret) {
DRM_ERROR("Failed to runtime PM enable on DSI%d\n", dsi->variant->port); drm_err(bridge->dev, "Failed to runtime PM enable on DSI%d\n", dsi->variant->port);
return; return;
} }
...@@ -986,13 +987,14 @@ static void vc4_dsi_bridge_pre_enable(struct drm_bridge *bridge, ...@@ -986,13 +987,14 @@ static void vc4_dsi_bridge_pre_enable(struct drm_bridge *bridge,
ret = clk_prepare_enable(dsi->escape_clock); ret = clk_prepare_enable(dsi->escape_clock);
if (ret) { if (ret) {
DRM_ERROR("Failed to turn on DSI escape clock: %d\n", ret); drm_err(bridge->dev, "Failed to turn on DSI escape clock: %d\n",
ret);
return; return;
} }
ret = clk_prepare_enable(dsi->pll_phy_clock); ret = clk_prepare_enable(dsi->pll_phy_clock);
if (ret) { if (ret) {
DRM_ERROR("Failed to turn on DSI PLL: %d\n", ret); drm_err(bridge->dev, "Failed to turn on DSI PLL: %d\n", ret);
return; return;
} }
...@@ -1014,7 +1016,7 @@ static void vc4_dsi_bridge_pre_enable(struct drm_bridge *bridge, ...@@ -1014,7 +1016,7 @@ static void vc4_dsi_bridge_pre_enable(struct drm_bridge *bridge,
ret = clk_prepare_enable(dsi->pixel_clock); ret = clk_prepare_enable(dsi->pixel_clock);
if (ret) { if (ret) {
DRM_ERROR("Failed to turn on DSI pixel clock: %d\n", ret); drm_err(bridge->dev, "Failed to turn on DSI pixel clock: %d\n", ret);
return; return;
} }
...@@ -1172,6 +1174,7 @@ static ssize_t vc4_dsi_host_transfer(struct mipi_dsi_host *host, ...@@ -1172,6 +1174,7 @@ static ssize_t vc4_dsi_host_transfer(struct mipi_dsi_host *host,
const struct mipi_dsi_msg *msg) const struct mipi_dsi_msg *msg)
{ {
struct vc4_dsi *dsi = host_to_dsi(host); struct vc4_dsi *dsi = host_to_dsi(host);
struct drm_device *drm = dsi->bridge.dev;
struct mipi_dsi_packet packet; struct mipi_dsi_packet packet;
u32 pkth = 0, pktc = 0; u32 pkth = 0, pktc = 0;
int i, ret; int i, ret;
...@@ -1303,7 +1306,7 @@ static ssize_t vc4_dsi_host_transfer(struct mipi_dsi_host *host, ...@@ -1303,7 +1306,7 @@ static ssize_t vc4_dsi_host_transfer(struct mipi_dsi_host *host,
DSI_RXPKT1H_BC_PARAM); DSI_RXPKT1H_BC_PARAM);
if (rxlen != msg->rx_len) { if (rxlen != msg->rx_len) {
DRM_ERROR("DSI returned %db, expecting %db\n", drm_err(drm, "DSI returned %db, expecting %db\n",
rxlen, (int)msg->rx_len); rxlen, (int)msg->rx_len);
ret = -ENXIO; ret = -ENXIO;
goto reset_fifo_and_return; goto reset_fifo_and_return;
...@@ -1326,7 +1329,7 @@ static ssize_t vc4_dsi_host_transfer(struct mipi_dsi_host *host, ...@@ -1326,7 +1329,7 @@ static ssize_t vc4_dsi_host_transfer(struct mipi_dsi_host *host,
return ret; return ret;
reset_fifo_and_return: reset_fifo_and_return:
DRM_ERROR("DSI transfer failed, resetting: %d\n", ret); drm_err(drm, "DSI transfer failed, resetting: %d\n", ret);
DSI_PORT_WRITE(TXPKT1C, DSI_PORT_READ(TXPKT1C) & ~DSI_TXPKT1C_CMD_EN); DSI_PORT_WRITE(TXPKT1C, DSI_PORT_READ(TXPKT1C) & ~DSI_TXPKT1C_CMD_EN);
udelay(1); udelay(1);
...@@ -1468,7 +1471,8 @@ static void dsi_handle_error(struct vc4_dsi *dsi, ...@@ -1468,7 +1471,8 @@ static void dsi_handle_error(struct vc4_dsi *dsi,
if (!(stat & bit)) if (!(stat & bit))
return; return;
DRM_ERROR("DSI%d: %s error\n", dsi->variant->port, type); drm_err(dsi->bridge.dev, "DSI%d: %s error\n", dsi->variant->port,
type);
*ret = IRQ_HANDLED; *ret = IRQ_HANDLED;
} }
...@@ -1687,7 +1691,7 @@ static int vc4_dsi_bind(struct device *dev, struct device *master, void *data) ...@@ -1687,7 +1691,7 @@ static int vc4_dsi_bind(struct device *dev, struct device *master, void *data)
&dsi->reg_dma_paddr, &dsi->reg_dma_paddr,
GFP_KERNEL); GFP_KERNEL);
if (!dsi->reg_dma_mem) { if (!dsi->reg_dma_mem) {
DRM_ERROR("Failed to get DMA memory\n"); drm_err(drm, "Failed to get DMA memory\n");
return -ENOMEM; return -ENOMEM;
} }
...@@ -1702,7 +1706,7 @@ static int vc4_dsi_bind(struct device *dev, struct device *master, void *data) ...@@ -1702,7 +1706,7 @@ static int vc4_dsi_bind(struct device *dev, struct device *master, void *data)
if (IS_ERR(dsi->reg_dma_chan)) { if (IS_ERR(dsi->reg_dma_chan)) {
ret = PTR_ERR(dsi->reg_dma_chan); ret = PTR_ERR(dsi->reg_dma_chan);
if (ret != -EPROBE_DEFER) if (ret != -EPROBE_DEFER)
DRM_ERROR("Failed to get DMA channel: %d\n", drm_err(drm, "Failed to get DMA channel: %d\n",
ret); ret);
return ret; return ret;
} }
......
...@@ -832,7 +832,7 @@ vc4_get_bcl(struct drm_device *dev, struct vc4_exec_info *exec) ...@@ -832,7 +832,7 @@ vc4_get_bcl(struct drm_device *dev, struct vc4_exec_info *exec)
*/ */
temp = kvmalloc_array(temp_size, 1, GFP_KERNEL); temp = kvmalloc_array(temp_size, 1, GFP_KERNEL);
if (!temp) { if (!temp) {
DRM_ERROR("Failed to allocate storage for copying " drm_err(dev, "Failed to allocate storage for copying "
"in bin/render CLs.\n"); "in bin/render CLs.\n");
ret = -ENOMEM; ret = -ENOMEM;
goto fail; goto fail;
...@@ -866,7 +866,7 @@ vc4_get_bcl(struct drm_device *dev, struct vc4_exec_info *exec) ...@@ -866,7 +866,7 @@ vc4_get_bcl(struct drm_device *dev, struct vc4_exec_info *exec)
bo = vc4_bo_create(dev, exec_size, true, VC4_BO_TYPE_BCL); bo = vc4_bo_create(dev, exec_size, true, VC4_BO_TYPE_BCL);
if (IS_ERR(bo)) { if (IS_ERR(bo)) {
DRM_ERROR("Couldn't allocate BO for binning\n"); drm_err(dev, "Couldn't allocate BO for binning\n");
ret = PTR_ERR(bo); ret = PTR_ERR(bo);
goto fail; goto fail;
} }
...@@ -1153,10 +1153,9 @@ vc4_submit_cl_ioctl(struct drm_device *dev, void *data, ...@@ -1153,10 +1153,9 @@ vc4_submit_cl_ioctl(struct drm_device *dev, void *data,
} }
exec = kcalloc(1, sizeof(*exec), GFP_KERNEL); exec = kcalloc(1, sizeof(*exec), GFP_KERNEL);
if (!exec) { if (!exec)
DRM_ERROR("malloc failure on exec struct\n");
return -ENOMEM; return -ENOMEM;
}
exec->dev = vc4; exec->dev = vc4;
ret = vc4_v3d_pm_get(vc4); ret = vc4_v3d_pm_get(vc4);
......
...@@ -704,7 +704,7 @@ static int vc4_hdmi_write_infoframe(struct drm_connector *connector, ...@@ -704,7 +704,7 @@ static int vc4_hdmi_write_infoframe(struct drm_connector *connector,
ret = vc4_hdmi_stop_packet(vc4_hdmi, type, true); ret = vc4_hdmi_stop_packet(vc4_hdmi, type, true);
if (ret) { if (ret) {
DRM_ERROR("Failed to wait for infoframe to go idle: %d\n", ret); drm_err(drm, "Failed to wait for infoframe to go idle: %d\n", ret);
goto out; goto out;
} }
...@@ -740,7 +740,7 @@ static int vc4_hdmi_write_infoframe(struct drm_connector *connector, ...@@ -740,7 +740,7 @@ static int vc4_hdmi_write_infoframe(struct drm_connector *connector,
ret = wait_for((HDMI_READ(HDMI_RAM_PACKET_STATUS) & ret = wait_for((HDMI_READ(HDMI_RAM_PACKET_STATUS) &
BIT(packet_id)), 100); BIT(packet_id)), 100);
if (ret) if (ret)
DRM_ERROR("Failed to wait for infoframe to start: %d\n", ret); drm_err(drm, "Failed to wait for infoframe to start: %d\n", ret);
out: out:
drm_dev_exit(idx); drm_dev_exit(idx);
...@@ -901,7 +901,7 @@ static void vc4_hdmi_encoder_post_crtc_powerdown(struct drm_encoder *encoder, ...@@ -901,7 +901,7 @@ static void vc4_hdmi_encoder_post_crtc_powerdown(struct drm_encoder *encoder,
ret = pm_runtime_put(&vc4_hdmi->pdev->dev); ret = pm_runtime_put(&vc4_hdmi->pdev->dev);
if (ret < 0) if (ret < 0)
DRM_ERROR("Failed to release power domain: %d\n", ret); drm_err(drm, "Failed to release power domain: %d\n", ret);
drm_dev_exit(idx); drm_dev_exit(idx);
...@@ -1443,7 +1443,7 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder, ...@@ -1443,7 +1443,7 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder,
ret = pm_runtime_resume_and_get(&vc4_hdmi->pdev->dev); ret = pm_runtime_resume_and_get(&vc4_hdmi->pdev->dev);
if (ret < 0) { if (ret < 0) {
DRM_ERROR("Failed to retain power domain: %d\n", ret); drm_err(drm, "Failed to retain power domain: %d\n", ret);
goto err_dev_exit; goto err_dev_exit;
} }
...@@ -1468,19 +1468,19 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder, ...@@ -1468,19 +1468,19 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder,
div_u64(tmds_char_rate, 100) * 101); div_u64(tmds_char_rate, 100) * 101);
ret = clk_set_min_rate(vc4_hdmi->hsm_clock, hsm_rate); ret = clk_set_min_rate(vc4_hdmi->hsm_clock, hsm_rate);
if (ret) { if (ret) {
DRM_ERROR("Failed to set HSM clock rate: %d\n", ret); drm_err(drm, "Failed to set HSM clock rate: %d\n", ret);
goto err_put_runtime_pm; goto err_put_runtime_pm;
} }
ret = clk_set_rate(vc4_hdmi->pixel_clock, tmds_char_rate); ret = clk_set_rate(vc4_hdmi->pixel_clock, tmds_char_rate);
if (ret) { if (ret) {
DRM_ERROR("Failed to set pixel clock rate: %d\n", ret); drm_err(drm, "Failed to set pixel clock rate: %d\n", ret);
goto err_put_runtime_pm; goto err_put_runtime_pm;
} }
ret = clk_prepare_enable(vc4_hdmi->pixel_clock); ret = clk_prepare_enable(vc4_hdmi->pixel_clock);
if (ret) { if (ret) {
DRM_ERROR("Failed to turn on pixel clock: %d\n", ret); drm_err(drm, "Failed to turn on pixel clock: %d\n", ret);
goto err_put_runtime_pm; goto err_put_runtime_pm;
} }
...@@ -1496,13 +1496,13 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder, ...@@ -1496,13 +1496,13 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder,
ret = clk_set_min_rate(vc4_hdmi->pixel_bvb_clock, bvb_rate); ret = clk_set_min_rate(vc4_hdmi->pixel_bvb_clock, bvb_rate);
if (ret) { if (ret) {
DRM_ERROR("Failed to set pixel bvb clock rate: %d\n", ret); drm_err(drm, "Failed to set pixel bvb clock rate: %d\n", ret);
goto err_disable_pixel_clock; goto err_disable_pixel_clock;
} }
ret = clk_prepare_enable(vc4_hdmi->pixel_bvb_clock); ret = clk_prepare_enable(vc4_hdmi->pixel_bvb_clock);
if (ret) { if (ret) {
DRM_ERROR("Failed to turn on pixel bvb clock: %d\n", ret); drm_err(drm, "Failed to turn on pixel bvb clock: %d\n", ret);
goto err_disable_pixel_clock; goto err_disable_pixel_clock;
} }
...@@ -2951,13 +2951,13 @@ static int vc4_hdmi_init_resources(struct drm_device *drm, ...@@ -2951,13 +2951,13 @@ static int vc4_hdmi_init_resources(struct drm_device *drm,
if (IS_ERR(vc4_hdmi->pixel_clock)) { if (IS_ERR(vc4_hdmi->pixel_clock)) {
ret = PTR_ERR(vc4_hdmi->pixel_clock); ret = PTR_ERR(vc4_hdmi->pixel_clock);
if (ret != -EPROBE_DEFER) if (ret != -EPROBE_DEFER)
DRM_ERROR("Failed to get pixel clock\n"); drm_err(drm, "Failed to get pixel clock\n");
return ret; return ret;
} }
vc4_hdmi->hsm_clock = devm_clk_get(dev, "hdmi"); vc4_hdmi->hsm_clock = devm_clk_get(dev, "hdmi");
if (IS_ERR(vc4_hdmi->hsm_clock)) { if (IS_ERR(vc4_hdmi->hsm_clock)) {
DRM_ERROR("Failed to get HDMI state machine clock\n"); drm_err(drm, "Failed to get HDMI state machine clock\n");
return PTR_ERR(vc4_hdmi->hsm_clock); return PTR_ERR(vc4_hdmi->hsm_clock);
} }
vc4_hdmi->audio_clock = vc4_hdmi->hsm_clock; vc4_hdmi->audio_clock = vc4_hdmi->hsm_clock;
...@@ -3041,31 +3041,31 @@ static int vc5_hdmi_init_resources(struct drm_device *drm, ...@@ -3041,31 +3041,31 @@ static int vc5_hdmi_init_resources(struct drm_device *drm,
vc4_hdmi->hsm_clock = devm_clk_get(dev, "hdmi"); vc4_hdmi->hsm_clock = devm_clk_get(dev, "hdmi");
if (IS_ERR(vc4_hdmi->hsm_clock)) { if (IS_ERR(vc4_hdmi->hsm_clock)) {
DRM_ERROR("Failed to get HDMI state machine clock\n"); drm_err(drm, "Failed to get HDMI state machine clock\n");
return PTR_ERR(vc4_hdmi->hsm_clock); return PTR_ERR(vc4_hdmi->hsm_clock);
} }
vc4_hdmi->pixel_bvb_clock = devm_clk_get(dev, "bvb"); vc4_hdmi->pixel_bvb_clock = devm_clk_get(dev, "bvb");
if (IS_ERR(vc4_hdmi->pixel_bvb_clock)) { if (IS_ERR(vc4_hdmi->pixel_bvb_clock)) {
DRM_ERROR("Failed to get pixel bvb clock\n"); drm_err(drm, "Failed to get pixel bvb clock\n");
return PTR_ERR(vc4_hdmi->pixel_bvb_clock); return PTR_ERR(vc4_hdmi->pixel_bvb_clock);
} }
vc4_hdmi->audio_clock = devm_clk_get(dev, "audio"); vc4_hdmi->audio_clock = devm_clk_get(dev, "audio");
if (IS_ERR(vc4_hdmi->audio_clock)) { if (IS_ERR(vc4_hdmi->audio_clock)) {
DRM_ERROR("Failed to get audio clock\n"); drm_err(drm, "Failed to get audio clock\n");
return PTR_ERR(vc4_hdmi->audio_clock); return PTR_ERR(vc4_hdmi->audio_clock);
} }
vc4_hdmi->cec_clock = devm_clk_get(dev, "cec"); vc4_hdmi->cec_clock = devm_clk_get(dev, "cec");
if (IS_ERR(vc4_hdmi->cec_clock)) { if (IS_ERR(vc4_hdmi->cec_clock)) {
DRM_ERROR("Failed to get CEC clock\n"); drm_err(drm, "Failed to get CEC clock\n");
return PTR_ERR(vc4_hdmi->cec_clock); return PTR_ERR(vc4_hdmi->cec_clock);
} }
vc4_hdmi->reset = devm_reset_control_get(dev, NULL); vc4_hdmi->reset = devm_reset_control_get(dev, NULL);
if (IS_ERR(vc4_hdmi->reset)) { if (IS_ERR(vc4_hdmi->reset)) {
DRM_ERROR("Failed to get HDMI reset line\n"); drm_err(drm, "Failed to get HDMI reset line\n");
return PTR_ERR(vc4_hdmi->reset); return PTR_ERR(vc4_hdmi->reset);
} }
...@@ -3221,14 +3221,14 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) ...@@ -3221,14 +3221,14 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data)
ddc_node = of_parse_phandle(dev->of_node, "ddc", 0); ddc_node = of_parse_phandle(dev->of_node, "ddc", 0);
if (!ddc_node) { if (!ddc_node) {
DRM_ERROR("Failed to find ddc node in device tree\n"); drm_err(drm, "Failed to find ddc node in device tree\n");
return -ENODEV; return -ENODEV;
} }
vc4_hdmi->ddc = of_find_i2c_adapter_by_node(ddc_node); vc4_hdmi->ddc = of_find_i2c_adapter_by_node(ddc_node);
of_node_put(ddc_node); of_node_put(ddc_node);
if (!vc4_hdmi->ddc) { if (!vc4_hdmi->ddc) {
DRM_DEBUG("Failed to get ddc i2c adapter by node\n"); drm_err(drm, "Failed to get ddc i2c adapter by node\n");
return -EPROBE_DEFER; return -EPROBE_DEFER;
} }
......
...@@ -191,7 +191,7 @@ static int vc4_hvs_upload_linear_kernel(struct vc4_hvs *hvs, ...@@ -191,7 +191,7 @@ static int vc4_hvs_upload_linear_kernel(struct vc4_hvs *hvs,
ret = drm_mm_insert_node(&hvs->dlist_mm, space, VC4_KERNEL_DWORDS); ret = drm_mm_insert_node(&hvs->dlist_mm, space, VC4_KERNEL_DWORDS);
if (ret) { if (ret) {
DRM_ERROR("Failed to allocate space for filter kernel: %d\n", drm_err(&hvs->vc4->base, "Failed to allocate space for filter kernel: %d\n",
ret); ret);
return ret; return ret;
} }
......
...@@ -76,7 +76,7 @@ vc4_overflow_mem_work(struct work_struct *work) ...@@ -76,7 +76,7 @@ vc4_overflow_mem_work(struct work_struct *work)
bin_bo_slot = vc4_v3d_get_bin_slot(vc4); bin_bo_slot = vc4_v3d_get_bin_slot(vc4);
if (bin_bo_slot < 0) { if (bin_bo_slot < 0) {
DRM_ERROR("Couldn't allocate binner overflow mem\n"); drm_err(&vc4->base, "Couldn't allocate binner overflow mem\n");
goto complete; goto complete;
} }
......
...@@ -471,7 +471,7 @@ static int vc4_v3d_bind(struct device *dev, struct device *master, void *data) ...@@ -471,7 +471,7 @@ static int vc4_v3d_bind(struct device *dev, struct device *master, void *data)
return ret; return ret;
if (V3D_READ(V3D_IDENT0) != V3D_EXPECTED_IDENT0) { if (V3D_READ(V3D_IDENT0) != V3D_EXPECTED_IDENT0) {
DRM_ERROR("V3D_IDENT0 read 0x%08x instead of 0x%08x\n", drm_err(drm, "V3D_IDENT0 read 0x%08x instead of 0x%08x\n",
V3D_READ(V3D_IDENT0), V3D_EXPECTED_IDENT0); V3D_READ(V3D_IDENT0), V3D_EXPECTED_IDENT0);
ret = -EINVAL; ret = -EINVAL;
goto err_put_runtime_pm; goto err_put_runtime_pm;
...@@ -485,7 +485,7 @@ static int vc4_v3d_bind(struct device *dev, struct device *master, void *data) ...@@ -485,7 +485,7 @@ static int vc4_v3d_bind(struct device *dev, struct device *master, void *data)
ret = vc4_irq_install(drm, vc4->irq); ret = vc4_irq_install(drm, vc4->irq);
if (ret) { if (ret) {
DRM_ERROR("Failed to install IRQ handler\n"); drm_err(drm, "Failed to install IRQ handler\n");
goto err_put_runtime_pm; goto err_put_runtime_pm;
} }
......
...@@ -65,7 +65,7 @@ utile_width(int cpp) ...@@ -65,7 +65,7 @@ utile_width(int cpp)
case 8: case 8:
return 2; return 2;
default: default:
DRM_ERROR("unknown cpp: %d\n", cpp); pr_err("unknown cpp: %d\n", cpp);
return 1; return 1;
} }
} }
...@@ -82,7 +82,7 @@ utile_height(int cpp) ...@@ -82,7 +82,7 @@ utile_height(int cpp)
case 8: case 8:
return 4; return 4;
default: default:
DRM_ERROR("unknown cpp: %d\n", cpp); pr_err("unknown cpp: %d\n", cpp);
return 1; return 1;
} }
} }
...@@ -390,7 +390,7 @@ validate_tile_binning_config(VALIDATE_ARGS) ...@@ -390,7 +390,7 @@ validate_tile_binning_config(VALIDATE_ARGS)
bin_slot = vc4_v3d_get_bin_slot(vc4); bin_slot = vc4_v3d_get_bin_slot(vc4);
if (bin_slot < 0) { if (bin_slot < 0) {
if (bin_slot != -EINTR && bin_slot != -ERESTARTSYS) { if (bin_slot != -EINTR && bin_slot != -ERESTARTSYS) {
DRM_ERROR("Failed to allocate binner memory: %d\n", drm_err(dev, "Failed to allocate binner memory: %d\n",
bin_slot); bin_slot);
} }
return bin_slot; return bin_slot;
......
...@@ -557,7 +557,7 @@ static void vc4_vec_encoder_disable(struct drm_encoder *encoder, ...@@ -557,7 +557,7 @@ static void vc4_vec_encoder_disable(struct drm_encoder *encoder,
ret = pm_runtime_put(&vec->pdev->dev); ret = pm_runtime_put(&vec->pdev->dev);
if (ret < 0) { if (ret < 0) {
DRM_ERROR("Failed to release power domain: %d\n", ret); drm_err(drm, "Failed to release power domain: %d\n", ret);
goto err_dev_exit; goto err_dev_exit;
} }
...@@ -591,7 +591,7 @@ static void vc4_vec_encoder_enable(struct drm_encoder *encoder, ...@@ -591,7 +591,7 @@ static void vc4_vec_encoder_enable(struct drm_encoder *encoder,
ret = pm_runtime_resume_and_get(&vec->pdev->dev); ret = pm_runtime_resume_and_get(&vec->pdev->dev);
if (ret < 0) { if (ret < 0) {
DRM_ERROR("Failed to retain power domain: %d\n", ret); drm_err(drm, "Failed to retain power domain: %d\n", ret);
goto err_dev_exit; goto err_dev_exit;
} }
...@@ -604,13 +604,13 @@ static void vc4_vec_encoder_enable(struct drm_encoder *encoder, ...@@ -604,13 +604,13 @@ static void vc4_vec_encoder_enable(struct drm_encoder *encoder,
*/ */
ret = clk_set_rate(vec->clock, 108000000); ret = clk_set_rate(vec->clock, 108000000);
if (ret) { if (ret) {
DRM_ERROR("Failed to set clock rate: %d\n", ret); drm_err(drm, "Failed to set clock rate: %d\n", ret);
goto err_put_runtime_pm; goto err_put_runtime_pm;
} }
ret = clk_prepare_enable(vec->clock); ret = clk_prepare_enable(vec->clock);
if (ret) { if (ret) {
DRM_ERROR("Failed to turn on core clock: %d\n", ret); drm_err(drm, "Failed to turn on core clock: %d\n", ret);
goto err_put_runtime_pm; goto err_put_runtime_pm;
} }
...@@ -806,7 +806,7 @@ static int vc4_vec_bind(struct device *dev, struct device *master, void *data) ...@@ -806,7 +806,7 @@ static int vc4_vec_bind(struct device *dev, struct device *master, void *data)
if (IS_ERR(vec->clock)) { if (IS_ERR(vec->clock)) {
ret = PTR_ERR(vec->clock); ret = PTR_ERR(vec->clock);
if (ret != -EPROBE_DEFER) if (ret != -EPROBE_DEFER)
DRM_ERROR("Failed to get clock: %d\n", ret); drm_err(drm, "Failed to get clock: %d\n", ret);
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment