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
Unified · Split
| @@ -270,7 +270,7 @@ static int fsl_dcu_drm_pm_resume(struct device *dev) · 269 unmodified lines | ||
| 270 | 270 | ret = clk_prepare_enable(fsl_dev->pix_clk); |
| 271 | 271 | if (ret < 0) { |
| 272 | 272 | dev_err(dev, "failed to enable pix clk\n"); |
| 273 | − return ret; | |
| 273 | + goto disable_dcu_clk; | |
| 274 | 274 | } |
| 275 | 275 | |
| 276 | 276 | fsl_dcu_drm_init_planes(fsl_dev->drm); |
| @@ -284,6 +284,10 @@ static int fsl_dcu_drm_pm_resume(struct device *dev) · 7 unmodified lines | ||
| 284 | 284 | enable_irq(fsl_dev->irq); |
| 285 | 285 | |
| 286 | 286 | return 0; |
| 287 | + | |
| 288 | +disable_dcu_clk: | |
| 289 | + clk_disable_unprepare(fsl_dev->clk); | |
| 290 | + return ret; | |
| 287 | 291 | } |
| 288 | 292 | #endif |
| 289 | 293 | |
| @@ -330,6 +334,7 @@ static int fsl_dcu_drm_probe(struct platform_device *pdev) · 40 unmodified lines | ||
| 330 | 334 | const char *pix_clk_in_name; |
| 331 | 335 | const struct of_device_id *id; |
| 332 | 336 | int ret; |
| 337 | + u8 div_ratio_shift = 0; | |
| 333 | 338 | |
| 334 | 339 | fsl_dev = devm_kzalloc(dev, sizeof(*fsl_dev), GFP_KERNEL); |
| 335 | 340 | if (!fsl_dev) |
| @@ -382,11 +387,14 @@ static int fsl_dcu_drm_probe(struct platform_device *pdev) · 46 unmodified lines | ||
| 382 | 387 | pix_clk_in = fsl_dev->clk; |
| 383 | 388 | } |
| 384 | 389 | |
| 390 | + if (of_property_read_bool(dev->of_node, "big-endian")) | |
| 391 | + div_ratio_shift = 24; | |
| 392 | + | |
| 385 | 393 | pix_clk_in_name = __clk_get_name(pix_clk_in); |
| 386 | 394 | snprintf(pix_clk_name, sizeof(pix_clk_name), "%s_pix", pix_clk_in_name); |
| 387 | 395 | fsl_dev->pix_clk = clk_register_divider(dev, pix_clk_name, |
| 388 | 396 | pix_clk_in_name, 0, base + DCU_DIV_RATIO, |
| 389 | − 0, 8, CLK_DIVIDER_ROUND_CLOSEST, NULL); | |
| 397 | + div_ratio_shift, 8, CLK_DIVIDER_ROUND_CLOSEST, NULL); | |
| 390 | 398 | if (IS_ERR(fsl_dev->pix_clk)) { |
| 391 | 399 | dev_err(dev, "failed to register pix clk\n"); |
| 392 | 400 | ret = PTR_ERR(fsl_dev->pix_clk); |
| @@ -57,10 +57,7 @@ static int fsl_tcon_init_regmap(struct device *dev, · 56 unmodified lines | ||
| 57 | 57 | |
| 58 | 58 | tcon->regs = devm_regmap_init_mmio(dev, regs, |
| 59 | 59 | &fsl_tcon_regmap_config); |
| 60 | − if (IS_ERR(tcon->regs)) | |
| 61 | − return PTR_ERR(tcon->regs); | |
| 62 | − | |
| 63 | − return 0; | |
| 60 | + return PTR_ERR_OR_ZERO(tcon->regs); | |
| 64 | 61 | } |
| 65 | 62 | |
| 66 | 63 | struct fsl_tcon *fsl_tcon_init(struct device *dev) |