Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp4014779ybd; Tue, 25 Jun 2019 12:28:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqwUucnQt9BozXjthtZ9Po8pMSM5wksVfd1KKs6SJE9Yw0F8DPGNYZTjFdKmZokdew4UukpC X-Received: by 2002:a17:902:aa95:: with SMTP id d21mr322687plr.185.1561490889910; Tue, 25 Jun 2019 12:28:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561490889; cv=none; d=google.com; s=arc-20160816; b=aS38hCWfEl+nhk7x1wBr9ZZJPOwX+60twEAsECigO+7UzjLc7CNxenOYLP6upwmBsY U4trlrN+FK9Z4riATwWnb9hnPCTBm8hdaBJZ22bpa/mVV/8Kr99oNen5fPiTYOZjRALF tkTxl+qss5QkGtNxfBTEfn0qF61g0jQaMpIGk6zEKZLjCnfoceqDw2DX1n7HhypxxIvi vGip9FM5N37os5o2nZWyYQtm2GrQ0VN3h3I0CXXWiOmnnfK8JtBARXVSv3hQZiIN6e0C vR1A7Tipc6PuHv1ajXOZSJLn8crY69d5bxz9wiiPOJC1o3FhozPwyFv3eUeri86Jvueb 4TuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=bAOkVHO1BfkTnSJLTBWlqsTsKKDk8gdZ6nODPU4c1tE=; b=sT76qO3kzPOL8ufwK0fU5GE5a1f1+O897HHFi7mu/bb8jnct2LYFvzbZzWLl5bAiJE Sgw4Du1nN3kvH7qxK9JJcrWMe8PJLdnKa7NZeip3IGcBdTGwnU3de4aYIANsZu26HDvT RypYf6T/Tlc/+FgcsdpWXe4yA91qFbPaQ3h+qMfHgmyWSHX7T3j7xzRo2kpreqxLeog0 QvP32+HWtW49k6I3HVLIhtE/ljCpThxM+MsjenKei10wHjSVxxig2xsTFBdN/iTVNYFt FJgTtyr5HXj22po1q63H8RChk7XSX2WGxG7StGwK4S9nlDk3atkNsppRfhqVRRM3tXZN R8bw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=i50Tzhxo; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 32si1031536plb.86.2019.06.25.12.27.53; Tue, 25 Jun 2019 12:28:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=i50Tzhxo; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731767AbfFYQfK (ORCPT + 99 others); Tue, 25 Jun 2019 12:35:10 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:34846 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731523AbfFYQfG (ORCPT ); Tue, 25 Jun 2019 12:35:06 -0400 Received: by mail-wr1-f67.google.com with SMTP id f15so8743675wrp.2 for ; Tue, 25 Jun 2019 09:35:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bAOkVHO1BfkTnSJLTBWlqsTsKKDk8gdZ6nODPU4c1tE=; b=i50TzhxoE0EVWRZb7FuSgJwILA4rx2iPG77Mv3xcrrEJhVN4B/h7MPBBWVugqYxWp2 z/toOghI0xFLzo4j20BFkcTCK+t9oS1ur5Zxjuv68/EUxdI7HLW8oC2Nj9IGNwbxlkcf ppV6VXclq/A8Z0b+pcsB0R3xp2T8dBZGYEgPFrzfJRHQCawfFi+1EpUaRPuEwp5oe/TE cjUFukQoM00ogBXYvTqt763tfq4G+xwbOAaEuus8bhR4jpNdbtNk1PP3kxzDeiAC6IY4 zhd+wjbHvP1qPE3kwpdpje4Jp/GVei4mLQW7Kg6+P3xNN65ClIzjaWSbuQstQ63Hv5H+ 570A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bAOkVHO1BfkTnSJLTBWlqsTsKKDk8gdZ6nODPU4c1tE=; b=NCsluOrBln3/O5BuKbmTzLvumTu3rModK5moC95ivk1OeiPKrSiP4rM+K383GCSL1h Lq3ED/P0De7nqYNSZWY9oj7sntwviCCiCFDPJgNqgqP/uYG6/mAoCkE/CTe9+xf1h3/p FqoTILHp/ECxEVRFKWwODGqstef2dbDw8AJC7gUpqQMcX1G/HZTwQRmBo/zAyg5Whcn8 uyFZiBtkmvZWots9GoQ4fUoRbkLFuIMa5U+jKVaqzQ2dDzPgF9Mscer2yb9Q2/xwIdPO fzccWKyBtJjhrYdUBGOe3x3+ktYeYVwQ5hNoMGIg3vXzOK/KsoKjNTks7JxD7c6NIi56 JtBg== X-Gm-Message-State: APjAAAXqzzn+PUaVGYkxxvf11LPj6c1pHVEtQEY8lL/fGRUE09bXfySG fKwPGabFsfYWIculkeUbvHrwHw== X-Received: by 2002:adf:e691:: with SMTP id r17mr62365819wrm.67.1561480505225; Tue, 25 Jun 2019 09:35:05 -0700 (PDT) Received: from debian-brgl.home ([2a01:cb1d:af:5b00:6d6c:8493:1ab5:dad7]) by smtp.gmail.com with ESMTPSA id g8sm2683795wme.20.2019.06.25.09.35.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Jun 2019 09:35:04 -0700 (PDT) From: Bartosz Golaszewski To: Sekhar Nori , Kevin Hilman , Lee Jones , Daniel Thompson , Jingoo Han , Bartlomiej Zolnierkiewicz , David Lechner , Linus Walleij Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH 11/12] fbdev: da8xx-fb: drop a redundant if Date: Tue, 25 Jun 2019 18:34:33 +0200 Message-Id: <20190625163434.13620-12-brgl@bgdev.pl> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190625163434.13620-1-brgl@bgdev.pl> References: <20190625163434.13620-1-brgl@bgdev.pl> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bartosz Golaszewski 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 --- drivers/video/fbdev/da8xx-fb.c | 43 ++++++++++++++++------------------ 1 file changed, 20 insertions(+), 23 deletions(-) diff --git a/drivers/video/fbdev/da8xx-fb.c b/drivers/video/fbdev/da8xx-fb.c index 4dda194d6b8f..6b11a8108108 100644 --- a/drivers/video/fbdev/da8xx-fb.c +++ b/drivers/video/fbdev/da8xx-fb.c @@ -1067,37 +1067,34 @@ static void lcd_da8xx_cpufreq_deregister(struct da8xx_fb_par *par) static int fb_remove(struct platform_device *dev) { struct fb_info *info = dev_get_drvdata(&dev->dev); + struct da8xx_fb_par *par = info->par; int ret; - if (info) { - struct da8xx_fb_par *par = info->par; - #ifdef CONFIG_CPU_FREQ - lcd_da8xx_cpufreq_deregister(par); + lcd_da8xx_cpufreq_deregister(par); #endif - if (par->lcd_supply) { - ret = regulator_disable(par->lcd_supply); - if (ret) - return ret; - } + if (par->lcd_supply) { + ret = regulator_disable(par->lcd_supply); + if (ret) + return ret; + } - lcd_disable_raster(DA8XX_FRAME_WAIT); - lcdc_write(0, LCD_RASTER_CTRL_REG); + lcd_disable_raster(DA8XX_FRAME_WAIT); + lcdc_write(0, LCD_RASTER_CTRL_REG); - /* disable DMA */ - lcdc_write(0, LCD_DMA_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); + 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; } -- 2.21.0