diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-21 17:38:49 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-21 17:38:49 -0800 |
commit | 7c2db36e730ee4facd341679ecb21ee73ba92831 (patch) | |
tree | 75016fba72aaf0581b9263f7fa4c565e6e634f3c /drivers/video/exynos | |
parent | 8b5628ab83b671f96ac9f174c1bd51c92589fc82 (diff) | |
parent | a47a376f1c025e23e836c0376813c0424de665c2 (diff) |
Merge branch 'akpm' (incoming from Andrew)
Merge misc patches from Andrew Morton:
- Florian has vanished so I appear to have become fbdev maintainer
again :(
- Joel and Mark are distracted to welcome to the new OCFS2 maintainer
- The backlight queue
- Small core kernel changes
- lib/ updates
- The rtc queue
- Various random bits
* akpm: (164 commits)
rtc: rtc-davinci: use devm_*() functions
rtc: rtc-max8997: use devm_request_threaded_irq()
rtc: rtc-max8907: use devm_request_threaded_irq()
rtc: rtc-da9052: use devm_request_threaded_irq()
rtc: rtc-wm831x: use devm_request_threaded_irq()
rtc: rtc-tps80031: use devm_request_threaded_irq()
rtc: rtc-lp8788: use devm_request_threaded_irq()
rtc: rtc-coh901331: use devm_clk_get()
rtc: rtc-vt8500: use devm_*() functions
rtc: rtc-tps6586x: use devm_request_threaded_irq()
rtc: rtc-imxdi: use devm_clk_get()
rtc: rtc-cmos: use dev_warn()/dev_dbg() instead of printk()/pr_debug()
rtc: rtc-pcf8583: use dev_warn() instead of printk()
rtc: rtc-sun4v: use pr_warn() instead of printk()
rtc: rtc-vr41xx: use dev_info() instead of printk()
rtc: rtc-rs5c313: use pr_err() instead of printk()
rtc: rtc-at91rm9200: use dev_dbg()/dev_err() instead of printk()/pr_debug()
rtc: rtc-rs5c372: use dev_dbg()/dev_warn() instead of printk()/pr_debug()
rtc: rtc-ds2404: use dev_err() instead of printk()
rtc: rtc-efi: use dev_err()/dev_warn()/pr_err() instead of printk()
...
Diffstat (limited to 'drivers/video/exynos')
-rw-r--r-- | drivers/video/exynos/exynos_dp_core.c | 23 | ||||
-rw-r--r-- | drivers/video/exynos/exynos_mipi_dsi.c | 70 | ||||
-rw-r--r-- | drivers/video/exynos/s6e8ax0.c | 14 |
3 files changed, 37 insertions, 70 deletions
diff --git a/drivers/video/exynos/exynos_dp_core.c b/drivers/video/exynos/exynos_dp_core.c index 2ed97769aa6d..de9d4da0e3da 100644 --- a/drivers/video/exynos/exynos_dp_core.c +++ b/drivers/video/exynos/exynos_dp_core.c @@ -965,10 +965,11 @@ static struct exynos_dp_platdata *exynos_dp_dt_parse_pdata(struct device *dev) static int exynos_dp_dt_parse_phydata(struct exynos_dp_device *dp) { - struct device_node *dp_phy_node; + struct device_node *dp_phy_node = of_node_get(dp->dev->of_node); u32 phy_base; + int ret = 0; - dp_phy_node = of_find_node_by_name(dp->dev->of_node, "dptx-phy"); + dp_phy_node = of_find_node_by_name(dp_phy_node, "dptx-phy"); if (!dp_phy_node) { dev_err(dp->dev, "could not find dptx-phy node\n"); return -ENODEV; @@ -976,22 +977,28 @@ static int exynos_dp_dt_parse_phydata(struct exynos_dp_device *dp) if (of_property_read_u32(dp_phy_node, "reg", &phy_base)) { dev_err(dp->dev, "faild to get reg for dptx-phy\n"); - return -EINVAL; + ret = -EINVAL; + goto err; } if (of_property_read_u32(dp_phy_node, "samsung,enable-mask", &dp->enable_mask)) { dev_err(dp->dev, "faild to get enable-mask for dptx-phy\n"); - return -EINVAL; + ret = -EINVAL; + goto err; } dp->phy_addr = ioremap(phy_base, SZ_4); if (!dp->phy_addr) { dev_err(dp->dev, "failed to ioremap dp-phy\n"); - return -ENOMEM; + ret = -ENOMEM; + goto err; } - return 0; +err: + of_node_put(dp_phy_node); + + return ret; } static void exynos_dp_phy_init(struct exynos_dp_device *dp) @@ -1117,8 +1124,6 @@ static int exynos_dp_remove(struct platform_device *pdev) struct exynos_dp_platdata *pdata = pdev->dev.platform_data; struct exynos_dp_device *dp = platform_get_drvdata(pdev); - disable_irq(dp->irq); - flush_work(&dp->hotplug_work); if (pdev->dev.of_node) { @@ -1141,6 +1146,8 @@ static int exynos_dp_suspend(struct device *dev) struct exynos_dp_platdata *pdata = dev->platform_data; struct exynos_dp_device *dp = dev_get_drvdata(dev); + disable_irq(dp->irq); + flush_work(&dp->hotplug_work); if (dev->of_node) { diff --git a/drivers/video/exynos/exynos_mipi_dsi.c b/drivers/video/exynos/exynos_mipi_dsi.c index 4a17cdccef34..fac7df6d1aba 100644 --- a/drivers/video/exynos/exynos_mipi_dsi.c +++ b/drivers/video/exynos/exynos_mipi_dsi.c @@ -338,7 +338,8 @@ static int exynos_mipi_dsi_probe(struct platform_device *pdev) struct mipi_dsim_ddi *dsim_ddi; int ret = -EINVAL; - dsim = kzalloc(sizeof(struct mipi_dsim_device), GFP_KERNEL); + dsim = devm_kzalloc(&pdev->dev, sizeof(struct mipi_dsim_device), + GFP_KERNEL); if (!dsim) { dev_err(&pdev->dev, "failed to allocate dsim object.\n"); return -ENOMEM; @@ -352,13 +353,13 @@ static int exynos_mipi_dsi_probe(struct platform_device *pdev) dsim_pd = (struct mipi_dsim_platform_data *)dsim->pd; if (dsim_pd == NULL) { dev_err(&pdev->dev, "failed to get platform data for dsim.\n"); - goto err_clock_get; + return -EINVAL; } /* get mipi_dsim_config. */ dsim_config = dsim_pd->dsim_config; if (dsim_config == NULL) { dev_err(&pdev->dev, "failed to get dsim config data.\n"); - goto err_clock_get; + return -EINVAL; } dsim->dsim_config = dsim_config; @@ -366,41 +367,28 @@ static int exynos_mipi_dsi_probe(struct platform_device *pdev) mutex_init(&dsim->lock); - ret = regulator_bulk_get(&pdev->dev, ARRAY_SIZE(supplies), supplies); + ret = devm_regulator_bulk_get(&pdev->dev, ARRAY_SIZE(supplies), + supplies); if (ret) { dev_err(&pdev->dev, "Failed to get regulators: %d\n", ret); - goto err_clock_get; + return ret; } - dsim->clock = clk_get(&pdev->dev, "dsim0"); + dsim->clock = devm_clk_get(&pdev->dev, "dsim0"); if (IS_ERR(dsim->clock)) { dev_err(&pdev->dev, "failed to get dsim clock source\n"); - ret = -ENODEV; - goto err_clock_get; + return -ENODEV; } clk_enable(dsim->clock); res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) { - dev_err(&pdev->dev, "failed to get io memory region\n"); - ret = -ENODEV; - goto err_platform_get; - } - - dsim->res = request_mem_region(res->start, resource_size(res), - dev_name(&pdev->dev)); - if (!dsim->res) { - dev_err(&pdev->dev, "failed to request io memory region\n"); - ret = -ENOMEM; - goto err_mem_region; - } - dsim->reg_base = ioremap(res->start, resource_size(res)); + dsim->reg_base = devm_request_and_ioremap(&pdev->dev, res); if (!dsim->reg_base) { dev_err(&pdev->dev, "failed to remap io region\n"); ret = -ENOMEM; - goto err_ioremap; + goto error; } mutex_init(&dsim->lock); @@ -410,26 +398,27 @@ static int exynos_mipi_dsi_probe(struct platform_device *pdev) if (!dsim_ddi) { dev_err(&pdev->dev, "mipi_dsim_ddi object not found.\n"); ret = -EINVAL; - goto err_bind; + goto error; } dsim->irq = platform_get_irq(pdev, 0); - if (dsim->irq < 0) { + if (IS_ERR_VALUE(dsim->irq)) { dev_err(&pdev->dev, "failed to request dsim irq resource\n"); ret = -EINVAL; - goto err_platform_get_irq; + goto error; } init_completion(&dsim_wr_comp); init_completion(&dsim_rd_comp); platform_set_drvdata(pdev, dsim); - ret = request_irq(dsim->irq, exynos_mipi_dsi_interrupt_handler, + ret = devm_request_irq(&pdev->dev, dsim->irq, + exynos_mipi_dsi_interrupt_handler, IRQF_SHARED, dev_name(&pdev->dev), dsim); if (ret != 0) { dev_err(&pdev->dev, "failed to request dsim irq\n"); ret = -EINVAL; - goto err_bind; + goto error; } /* enable interrupts */ @@ -471,22 +460,8 @@ done: return 0; -err_bind: - iounmap(dsim->reg_base); - -err_ioremap: - release_mem_region(dsim->res->start, resource_size(dsim->res)); - -err_mem_region: - release_resource(dsim->res); - -err_platform_get: +error: clk_disable(dsim->clock); - clk_put(dsim->clock); -err_clock_get: - kfree(dsim); - -err_platform_get_irq: return ret; } @@ -496,13 +471,7 @@ static int exynos_mipi_dsi_remove(struct platform_device *pdev) struct mipi_dsim_ddi *dsim_ddi, *next; struct mipi_dsim_lcd_driver *dsim_lcd_drv; - iounmap(dsim->reg_base); - clk_disable(dsim->clock); - clk_put(dsim->clock); - - release_resource(dsim->res); - release_mem_region(dsim->res->start, resource_size(dsim->res)); list_for_each_entry_safe(dsim_ddi, next, &dsim_ddi_list, list) { if (dsim_ddi) { @@ -518,9 +487,6 @@ static int exynos_mipi_dsi_remove(struct platform_device *pdev) } } - regulator_bulk_free(ARRAY_SIZE(supplies), supplies); - kfree(dsim); - return 0; } diff --git a/drivers/video/exynos/s6e8ax0.c b/drivers/video/exynos/s6e8ax0.c index 05d080b63bc0..ca2602413aa4 100644 --- a/drivers/video/exynos/s6e8ax0.c +++ b/drivers/video/exynos/s6e8ax0.c @@ -776,7 +776,7 @@ static int s6e8ax0_probe(struct mipi_dsim_lcd_device *dsim_dev) int ret; u8 mtp_id[3] = {0, }; - lcd = kzalloc(sizeof(struct s6e8ax0), GFP_KERNEL); + lcd = devm_kzalloc(&dsim_dev->dev, sizeof(struct s6e8ax0), GFP_KERNEL); if (!lcd) { dev_err(&dsim_dev->dev, "failed to allocate s6e8ax0 structure.\n"); return -ENOMEM; @@ -788,18 +788,17 @@ static int s6e8ax0_probe(struct mipi_dsim_lcd_device *dsim_dev) mutex_init(&lcd->lock); - ret = regulator_bulk_get(lcd->dev, ARRAY_SIZE(supplies), supplies); + ret = devm_regulator_bulk_get(lcd->dev, ARRAY_SIZE(supplies), supplies); if (ret) { dev_err(lcd->dev, "Failed to get regulators: %d\n", ret); - goto err_lcd_register; + return ret; } lcd->ld = lcd_device_register("s6e8ax0", lcd->dev, lcd, &s6e8ax0_lcd_ops); if (IS_ERR(lcd->ld)) { dev_err(lcd->dev, "failed to register lcd ops.\n"); - ret = PTR_ERR(lcd->ld); - goto err_lcd_register; + return PTR_ERR(lcd->ld); } lcd->bd = backlight_device_register("s6e8ax0-bl", lcd->dev, lcd, @@ -838,11 +837,6 @@ static int s6e8ax0_probe(struct mipi_dsim_lcd_device *dsim_dev) err_backlight_register: lcd_device_unregister(lcd->ld); - -err_lcd_register: - regulator_bulk_free(ARRAY_SIZE(supplies), supplies); - kfree(lcd); - return ret; } |