mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-10 15:10:38 +00:00
fbdev: da8xx-fb: drop a redundant if
The driver data is always set in probe. The remove() callback won't be called if probe failed which is the only way for it to be NULL. Remove the redundant if. Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Signed-off-by: Sekhar Nori <nsekhar@ti.com>
This commit is contained in:
parent
c957c88f7b
commit
8a3665f72d
@ -1067,37 +1067,34 @@ static void lcd_da8xx_cpufreq_deregister(struct da8xx_fb_par *par)
|
|||||||
static int fb_remove(struct platform_device *dev)
|
static int fb_remove(struct platform_device *dev)
|
||||||
{
|
{
|
||||||
struct fb_info *info = dev_get_drvdata(&dev->dev);
|
struct fb_info *info = dev_get_drvdata(&dev->dev);
|
||||||
|
struct da8xx_fb_par *par = info->par;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (info) {
|
|
||||||
struct da8xx_fb_par *par = info->par;
|
|
||||||
|
|
||||||
#ifdef CONFIG_CPU_FREQ
|
#ifdef CONFIG_CPU_FREQ
|
||||||
lcd_da8xx_cpufreq_deregister(par);
|
lcd_da8xx_cpufreq_deregister(par);
|
||||||
#endif
|
#endif
|
||||||
if (par->lcd_supply) {
|
if (par->lcd_supply) {
|
||||||
ret = regulator_disable(par->lcd_supply);
|
ret = regulator_disable(par->lcd_supply);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
|
||||||
|
|
||||||
lcd_disable_raster(DA8XX_FRAME_WAIT);
|
|
||||||
lcdc_write(0, LCD_RASTER_CTRL_REG);
|
|
||||||
|
|
||||||
/* disable DMA */
|
|
||||||
lcdc_write(0, LCD_DMA_CTRL_REG);
|
|
||||||
|
|
||||||
unregister_framebuffer(info);
|
|
||||||
fb_dealloc_cmap(&info->cmap);
|
|
||||||
dma_free_coherent(par->dev, PALETTE_SIZE, par->v_palette_base,
|
|
||||||
par->p_palette_base);
|
|
||||||
dma_free_coherent(par->dev, par->vram_size, par->vram_virt,
|
|
||||||
par->vram_phys);
|
|
||||||
pm_runtime_put_sync(&dev->dev);
|
|
||||||
pm_runtime_disable(&dev->dev);
|
|
||||||
framebuffer_release(info);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
lcd_disable_raster(DA8XX_FRAME_WAIT);
|
||||||
|
lcdc_write(0, LCD_RASTER_CTRL_REG);
|
||||||
|
|
||||||
|
/* disable DMA */
|
||||||
|
lcdc_write(0, LCD_DMA_CTRL_REG);
|
||||||
|
|
||||||
|
unregister_framebuffer(info);
|
||||||
|
fb_dealloc_cmap(&info->cmap);
|
||||||
|
dma_free_coherent(par->dev, PALETTE_SIZE, par->v_palette_base,
|
||||||
|
par->p_palette_base);
|
||||||
|
dma_free_coherent(par->dev, par->vram_size, par->vram_virt,
|
||||||
|
par->vram_phys);
|
||||||
|
pm_runtime_put_sync(&dev->dev);
|
||||||
|
pm_runtime_disable(&dev->dev);
|
||||||
|
framebuffer_release(info);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user