Skip to content

Commit

Permalink
drm/exynos: replace request_threaded_irq with devm function
Browse files Browse the repository at this point in the history
devm_request_threaded_irq is used instead of request_threaded_irq
and free_irq is removed.

Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
  • Loading branch information
Seung-Woo Kim authored and Inki Dae committed May 23, 2013
1 parent 7a1b00e commit dcb9a7c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 26 deletions.
8 changes: 2 additions & 6 deletions drivers/gpu/drm/exynos/exynos_drm_fimc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1845,7 +1845,7 @@ static int fimc_probe(struct platform_device *pdev)
}

ctx->irq = res->start;
ret = request_threaded_irq(ctx->irq, NULL, fimc_irq_handler,
ret = devm_request_threaded_irq(dev, ctx->irq, NULL, fimc_irq_handler,
IRQF_ONESHOT, "drm_fimc", ctx);
if (ret < 0) {
dev_err(dev, "failed to request irq.\n");
Expand All @@ -1854,7 +1854,7 @@ static int fimc_probe(struct platform_device *pdev)

ret = fimc_setup_clocks(ctx);
if (ret < 0)
goto err_free_irq;
return ret;

ippdrv = &ctx->ippdrv;
ippdrv->ops[EXYNOS_DRM_OPS_SRC] = &fimc_src_ops;
Expand Down Expand Up @@ -1892,8 +1892,6 @@ static int fimc_probe(struct platform_device *pdev)
pm_runtime_disable(dev);
err_put_clk:
fimc_put_clocks(ctx);
err_free_irq:
free_irq(ctx->irq, ctx);

return ret;
}
Expand All @@ -1911,8 +1909,6 @@ static int fimc_remove(struct platform_device *pdev)
pm_runtime_set_suspended(dev);
pm_runtime_disable(dev);

free_irq(ctx->irq, ctx);

return 0;
}

Expand Down
8 changes: 2 additions & 6 deletions drivers/gpu/drm/exynos/exynos_drm_gsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1704,7 +1704,7 @@ static int gsc_probe(struct platform_device *pdev)
}

ctx->irq = res->start;
ret = request_threaded_irq(ctx->irq, NULL, gsc_irq_handler,
ret = devm_request_threaded_irq(dev, ctx->irq, NULL, gsc_irq_handler,
IRQF_ONESHOT, "drm_gsc", ctx);
if (ret < 0) {
dev_err(dev, "failed to request irq.\n");
Expand All @@ -1725,7 +1725,7 @@ static int gsc_probe(struct platform_device *pdev)
ret = gsc_init_prop_list(ippdrv);
if (ret < 0) {
dev_err(dev, "failed to init property list.\n");
goto err_get_irq;
return ret;
}

DRM_DEBUG_KMS("%s:id[%d]ippdrv[0x%x]\n", __func__, ctx->id,
Expand All @@ -1749,8 +1749,6 @@ static int gsc_probe(struct platform_device *pdev)

err_ippdrv_register:
pm_runtime_disable(dev);
err_get_irq:
free_irq(ctx->irq, ctx);
return ret;
}

Expand All @@ -1766,8 +1764,6 @@ static int gsc_remove(struct platform_device *pdev)
pm_runtime_set_suspended(dev);
pm_runtime_disable(dev);

free_irq(ctx->irq, ctx);

return 0;
}

Expand Down
11 changes: 3 additions & 8 deletions drivers/gpu/drm/exynos/exynos_drm_rotator.c
Original file line number Diff line number Diff line change
Expand Up @@ -666,8 +666,8 @@ static int rotator_probe(struct platform_device *pdev)
return rot->irq;
}

ret = request_threaded_irq(rot->irq, NULL, rotator_irq_handler,
IRQF_ONESHOT, "drm_rotator", rot);
ret = devm_request_threaded_irq(dev, rot->irq, NULL,
rotator_irq_handler, IRQF_ONESHOT, "drm_rotator", rot);
if (ret < 0) {
dev_err(dev, "failed to request irq\n");
return ret;
Expand All @@ -676,8 +676,7 @@ static int rotator_probe(struct platform_device *pdev)
rot->clock = devm_clk_get(dev, "rotator");
if (IS_ERR(rot->clock)) {
dev_err(dev, "failed to get clock\n");
ret = PTR_ERR(rot->clock);
goto err_clk_get;
return PTR_ERR(rot->clock);
}

pm_runtime_enable(dev);
Expand Down Expand Up @@ -710,8 +709,6 @@ static int rotator_probe(struct platform_device *pdev)

err_ippdrv_register:
pm_runtime_disable(dev);
err_clk_get:
free_irq(rot->irq, rot);
return ret;
}

Expand All @@ -725,8 +722,6 @@ static int rotator_remove(struct platform_device *pdev)

pm_runtime_disable(dev);

free_irq(rot->irq, rot);

return 0;
}

Expand Down
7 changes: 1 addition & 6 deletions drivers/gpu/drm/exynos/exynos_hdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -2046,7 +2046,7 @@ static int hdmi_probe(struct platform_device *pdev)

hdata->hpd = gpio_get_value(hdata->hpd_gpio);

ret = request_threaded_irq(hdata->irq, NULL,
ret = devm_request_threaded_irq(dev, hdata->irq, NULL,
hdmi_irq_thread, IRQF_TRIGGER_RISING |
IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
"hdmi", drm_hdmi_ctx);
Expand Down Expand Up @@ -2075,16 +2075,11 @@ static int hdmi_probe(struct platform_device *pdev)
static int hdmi_remove(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct exynos_drm_hdmi_context *ctx = platform_get_drvdata(pdev);
struct hdmi_context *hdata = ctx->ctx;

DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);

pm_runtime_disable(dev);

free_irq(hdata->irq, ctx);


/* hdmiphy i2c driver */
i2c_del_driver(&hdmiphy_driver);
/* DDC i2c driver */
Expand Down

0 comments on commit dcb9a7c

Please sign in to comment.