Merge branch 'for-next' of http://git.agner.ch/git/linux-drm-fsl-dcu into drm-next

fsl-dcu fixes.

* 'for-next' of http://git.agner.ch/git/linux-drm-fsl-dcu:
  drm/fsl-dcu: disable clock on error path
  drm/fsl-dcu: use PTR_ERR_OR_ZERO() to simplify the code
  drm/fsl-dcu: fix endian issue when using clk_register_divider
This commit is contained in:
Dave Airlie 2016-09-21 06:28:25 +10:00
commit 52f13a02b7
2 changed files with 11 additions and 6 deletions

View File

@ -270,7 +270,7 @@ static int fsl_dcu_drm_pm_resume(struct device *dev)
ret = clk_prepare_enable(fsl_dev->pix_clk);
if (ret < 0) {
dev_err(dev, "failed to enable pix clk\n");
return ret;
goto disable_dcu_clk;
}
fsl_dcu_drm_init_planes(fsl_dev->drm);
@ -284,6 +284,10 @@ static int fsl_dcu_drm_pm_resume(struct device *dev)
enable_irq(fsl_dev->irq);
return 0;
disable_dcu_clk:
clk_disable_unprepare(fsl_dev->clk);
return ret;
}
#endif
@ -330,6 +334,7 @@ static int fsl_dcu_drm_probe(struct platform_device *pdev)
const char *pix_clk_in_name;
const struct of_device_id *id;
int ret;
u8 div_ratio_shift = 0;
fsl_dev = devm_kzalloc(dev, sizeof(*fsl_dev), GFP_KERNEL);
if (!fsl_dev)
@ -382,11 +387,14 @@ static int fsl_dcu_drm_probe(struct platform_device *pdev)
pix_clk_in = fsl_dev->clk;
}
if (of_property_read_bool(dev->of_node, "big-endian"))
div_ratio_shift = 24;
pix_clk_in_name = __clk_get_name(pix_clk_in);
snprintf(pix_clk_name, sizeof(pix_clk_name), "%s_pix", pix_clk_in_name);
fsl_dev->pix_clk = clk_register_divider(dev, pix_clk_name,
pix_clk_in_name, 0, base + DCU_DIV_RATIO,
0, 8, CLK_DIVIDER_ROUND_CLOSEST, NULL);
div_ratio_shift, 8, CLK_DIVIDER_ROUND_CLOSEST, NULL);
if (IS_ERR(fsl_dev->pix_clk)) {
dev_err(dev, "failed to register pix clk\n");
ret = PTR_ERR(fsl_dev->pix_clk);

View File

@ -57,10 +57,7 @@ static int fsl_tcon_init_regmap(struct device *dev,
tcon->regs = devm_regmap_init_mmio(dev, regs,
&fsl_tcon_regmap_config);
if (IS_ERR(tcon->regs))
return PTR_ERR(tcon->regs);
return 0;
return PTR_ERR_OR_ZERO(tcon->regs);
}
struct fsl_tcon *fsl_tcon_init(struct device *dev)