From patchwork Mon Aug 19 11:20:40 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 2846465 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 36A92BF546 for ; Mon, 19 Aug 2013 11:22:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2413520342 for ; Mon, 19 Aug 2013 11:22:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 05ED020316 for ; Mon, 19 Aug 2013 11:22:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751379Ab3HSLVF (ORCPT ); Mon, 19 Aug 2013 07:21:05 -0400 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:50170 "EHLO mail3-relais-sop.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751289Ab3HSLVE (ORCPT ); Mon, 19 Aug 2013 07:21:04 -0400 X-IronPort-AV: E=Sophos;i="4.89,913,1367964000"; d="scan'208";a="24233032" Received: from palace.lip6.fr (HELO localhost.localdomain) ([132.227.105.202]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 19 Aug 2013 13:20:44 +0200 From: Julia Lawall To: Jean-Christophe Plagniol-Villard Cc: kernel-janitors@vger.kernel.org, Tomi Valkeinen , linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 6/7] video: xilinxfb: replace devm_request_and_ioremap by devm_ioremap_resource Date: Mon, 19 Aug 2013 13:20:40 +0200 Message-Id: <1376911241-27720-7-git-send-email-Julia.Lawall@lip6.fr> X-Mailer: git-send-email 1.7.8.6 In-Reply-To: <1376911241-27720-1-git-send-email-Julia.Lawall@lip6.fr> References: <1376911241-27720-1-git-send-email-Julia.Lawall@lip6.fr> Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Spam-Status: No, score=-9.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Julia Lawall Use devm_ioremap_resource instead of devm_request_and_ioremap. This was done using the semantic patch scripts/coccinelle/api/devm_ioremap_resource.cocci The initialization of drvdata->regs_phys was manually moved lower, to take advantage of the NULL test on res performed by devm_ioremap_resource. Signed-off-by: Julia Lawall --- drivers/video/xilinxfb.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/video/xilinxfb.c b/drivers/video/xilinxfb.c index 6629b29..84c664e 100644 --- a/drivers/video/xilinxfb.c +++ b/drivers/video/xilinxfb.c @@ -259,12 +259,12 @@ static int xilinxfb_assign(struct platform_device *pdev, struct resource *res; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - drvdata->regs_phys = res->start; - drvdata->regs = devm_request_and_ioremap(&pdev->dev, res); - if (!drvdata->regs) { - rc = -EADDRNOTAVAIL; + drvdata->regs = devm_ioremap_resource(&pdev->dev, res); + if (IS_ERR(drvdata->regs)) { + rc = PTR_ERR(drvdata->regs); goto err_region; } + drvdata->regs_phys = res->start; } /* Allocate the framebuffer memory */