From patchwork Fri Sep 29 10:51:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 9977487 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3482460329 for ; Fri, 29 Sep 2017 10:51:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 38F7D29783 for ; Fri, 29 Sep 2017 10:51:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2DD5829810; Fri, 29 Sep 2017 10:51:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B582C29783 for ; Fri, 29 Sep 2017 10:51:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752059AbdI2KvU (ORCPT ); Fri, 29 Sep 2017 06:51:20 -0400 Received: from pandora.armlinux.org.uk ([78.32.30.218]:43884 "EHLO pandora.armlinux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751830AbdI2KvS (ORCPT ); Fri, 29 Sep 2017 06:51:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2014; h=Date:Sender:Message-Id:Content-Type:Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References:In-Reply-To; bh=DXkBbXovTA3C9bzwxgQPIIcN9eFbRo1mi7YR3fhtChI=; b=JTVbD94LkD0huR3xzrZVUcDtI5J1lBJDGeZmosNFVAtizn/LFWRB+MpRn/kIJkhq0fsj7IxSTvhWHuoq0EnGask2rZmGOe+dZ97uFctNI4xdowoxYbOsJPHRp8jCGV+gbeGopslYcJb5mzjCFnuHy2NOzIKYN/xHHNoY4jZfhJ0=; Received: from e0022681537dd.dyn.armlinux.org.uk ([2001:4d48:ad52:3201:222:68ff:fe15:37dd]:47026 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1dxst1-0000YC-DK; Fri, 29 Sep 2017 11:51:15 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1dxsst-0006j1-2Y; Fri, 29 Sep 2017 11:51:07 +0100 In-Reply-To: <20170929105004.GY20805@n2100.armlinux.org.uk> References: <20170929105004.GY20805@n2100.armlinux.org.uk> From: Russell King To: Bartlomiej Zolnierkiewicz Cc: linux-arm-kernel@lists.infradead.org, linux-fbdev@vger.kernel.org Subject: [PATCH 3/8] video: sa1100fb: use devm_ioremap_resource() MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Fri, 29 Sep 2017 11:51:07 +0100 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use devm_ioremap_resource() to map the LCD controller memory region, and remove the unnecessary cleanup for this. Signed-off-by: Russell King --- drivers/video/fbdev/sa1100fb.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/drivers/video/fbdev/sa1100fb.c b/drivers/video/fbdev/sa1100fb.c index 1562d7607dd2..ab83970dbfd9 100644 --- a/drivers/video/fbdev/sa1100fb.c +++ b/drivers/video/fbdev/sa1100fb.c @@ -1217,29 +1217,28 @@ static int sa1100fb_probe(struct platform_device *pdev) return -EINVAL; } - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); irq = platform_get_irq(pdev, 0); - if (irq < 0 || !res) + if (irq < 0) return -EINVAL; - if (!request_mem_region(res->start, resource_size(res), "LCD")) - return -EBUSY; - fbi = sa1100fb_init_fbinfo(&pdev->dev); ret = -ENOMEM; if (!fbi) goto failed; + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + fbi->base = devm_ioremap_resource(&pdev->dev, res); + if (IS_ERR(fbi->base)) { + ret = PTR_ERR(fbi->base); + goto failed; + } + fbi->clk = devm_clk_get(&pdev->dev, NULL); if (IS_ERR(fbi->clk)) { ret = PTR_ERR(fbi->clk); goto failed; } - fbi->base = ioremap(res->start, resource_size(res)); - if (!fbi->base) - goto failed; - /* Initialize video memory */ ret = sa1100fb_map_video_memory(fbi); if (ret) @@ -1286,9 +1285,6 @@ static int sa1100fb_probe(struct platform_device *pdev) err_free_irq: free_irq(irq, fbi); failed: - if (fbi) - iounmap(fbi->base); - release_mem_region(res->start, resource_size(res)); return ret; }