From patchwork Fri Sep 29 10:51:17 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: 9977491 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 5DFC960329 for ; Fri, 29 Sep 2017 10:51:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6272A29783 for ; Fri, 29 Sep 2017 10:51:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 576DB29810; Fri, 29 Sep 2017 10:51:29 +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 0E0E129783 for ; Fri, 29 Sep 2017 10:51:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751813AbdI2Kv2 (ORCPT ); Fri, 29 Sep 2017 06:51:28 -0400 Received: from pandora.armlinux.org.uk ([78.32.30.218]:43896 "EHLO pandora.armlinux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751224AbdI2Kv0 (ORCPT ); Fri, 29 Sep 2017 06:51:26 -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=hISmEkcS/HR3mtiVKgQFzea4JosLzR94TpAhQjui+hE=; b=i9FcCiFqOH1gt7/fd7/hD+1MvKLghoUHKFYGJJ9ULa1hTLEG6sEJ0We3GDgJXFax7HwDv0DRMVBHjks569m4zBLCbbfHPFmGfdkvLrygQJq3GfDq5BFtxx1VnQ/R8KClsLu05Nc7iUWfuRerQIo15CW0dWKeNM4godmn2kYr4bI=; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:36570 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 1dxstA-0000YQ-QW; Fri, 29 Sep 2017 11:51:24 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1dxst3-0006jG-JT; Fri, 29 Sep 2017 11:51:17 +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 5/8] video: sa1100fb: use devm_gpio_request_one() MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Fri, 29 Sep 2017 11:51:17 +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 Switch to using devm_gpio_request_one() to request the shannon gpio and move the request before the video memory allocation, so we request all device managed resources before this large allocation attempt. Signed-off-by: Russell King --- drivers/video/fbdev/sa1100fb.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/drivers/video/fbdev/sa1100fb.c b/drivers/video/fbdev/sa1100fb.c index a48fdb676f3e..7fa6c8f74ec6 100644 --- a/drivers/video/fbdev/sa1100fb.c +++ b/drivers/video/fbdev/sa1100fb.c @@ -1246,18 +1246,18 @@ static int sa1100fb_probe(struct platform_device *pdev) goto failed; } - /* Initialize video memory */ - ret = sa1100fb_map_video_memory(fbi); - if (ret) - goto failed; - if (machine_is_shannon()) { - ret = gpio_request_one(SHANNON_GPIO_DISP_EN, + ret = devm_gpio_request_one(&pdev->dev, SHANNON_GPIO_DISP_EN, GPIOF_OUT_INIT_LOW, "display enable"); if (ret) goto failed; } + /* Initialize video memory */ + ret = sa1100fb_map_video_memory(fbi); + if (ret) + goto failed; + /* * This makes sure that our colour bitfield * descriptors are correctly initialised. @@ -1268,7 +1268,7 @@ static int sa1100fb_probe(struct platform_device *pdev) ret = register_framebuffer(&fbi->fb); if (ret < 0) - goto err_reg_fb; + goto failed; #ifdef CONFIG_CPU_FREQ fbi->freq_transition.notifier_call = sa1100fb_freq_transition; @@ -1280,9 +1280,6 @@ static int sa1100fb_probe(struct platform_device *pdev) /* This driver cannot be unloaded at the moment */ return 0; - err_reg_fb: - if (machine_is_shannon()) - gpio_free(SHANNON_GPIO_DISP_EN); failed: return ret; }