From patchwork Mon Mar 4 08:15:21 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 2211391 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 599CE3FCF2 for ; Mon, 4 Mar 2013 08:25:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755522Ab3CDIZ4 (ORCPT ); Mon, 4 Mar 2013 03:25:56 -0500 Received: from mail-pa0-f48.google.com ([209.85.220.48]:61883 "EHLO mail-pa0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755457Ab3CDIZ4 (ORCPT ); Mon, 4 Mar 2013 03:25:56 -0500 Received: by mail-pa0-f48.google.com with SMTP id hz10so3004928pad.21 for ; Mon, 04 Mar 2013 00:25:55 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=xGoePtYCa95U0p591eaqMUwNJogwgDpL+oB2IP+mkuY=; b=VHrRwqultUue0NnXIBaj/p4Jbga0MvbGUlBoUDnnpk9ipXwqHlAlAx5/stc5Vd0mmr XyMMXE7+w50FqevD1y15AaJRys+G2Oeeaz7boRCXvVHKg7CZ7vXfIGmX4QJUhG9Q1PhG AJtM3X2LHcCtJ79/mtnocyNaqorsHpAZkoMGMk33pZTf/i8flp7QHPdnFjJSl6OTx5G8 B2ROSAMvT8vqgUwW/3lCwcesc/QHeUBOBpffJL4gTN+UMaPjvQa8zQIqbtnQlVWXV6iM RpIZSmBjC0Xbou5KTTAE1CxuCmPwLY2M/IAhzk3uNgMslBFRIuQzYXP7BHADdHdBocBJ ZXWg== X-Received: by 10.68.189.8 with SMTP id ge8mr6456969pbc.166.1362385555603; Mon, 04 Mar 2013 00:25:55 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id 1sm21552973pbg.18.2013.03.04.00.25.53 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 04 Mar 2013 00:25:55 -0800 (PST) From: Sachin Kamat To: linux-media@vger.kernel.org Cc: g.liakhovetski@gmx.de, sachin.kamat@linaro.org, thierry.reding@avionic-design.de Subject: [PATCH 4/4] [media] soc_camera/sh_mobile_csi2: Convert to devm_ioremap_resource() Date: Mon, 4 Mar 2013 13:45:21 +0530 Message-Id: <1362384921-7344-4-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1362384921-7344-1-git-send-email-sachin.kamat@linaro.org> References: <1362384921-7344-1-git-send-email-sachin.kamat@linaro.org> X-Gm-Message-State: ALoCoQm0dwNOBZcMB8x22zHErJwfRjfCZoNdKYLpFJai2nf9fQGdSCRDPKmatMAMqibvmUygf9lv Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Use the newly introduced devm_ioremap_resource() instead of devm_request_and_ioremap() which provides more consistent error handling. devm_ioremap_resource() provides its own error messages; so all explicit error messages can be removed from the failure code paths. Signed-off-by: Sachin Kamat Reviewed-by: Thierry Reding --- drivers/media/platform/soc_camera/sh_mobile_csi2.c | 9 ++++----- 1 files changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/media/platform/soc_camera/sh_mobile_csi2.c b/drivers/media/platform/soc_camera/sh_mobile_csi2.c index 42c559e..09cb4fc 100644 --- a/drivers/media/platform/soc_camera/sh_mobile_csi2.c +++ b/drivers/media/platform/soc_camera/sh_mobile_csi2.c @@ -9,6 +9,7 @@ */ #include +#include #include #include #include @@ -324,11 +325,9 @@ static int sh_csi2_probe(struct platform_device *pdev) priv->irq = irq; - priv->base = devm_request_and_ioremap(&pdev->dev, res); - if (!priv->base) { - dev_err(&pdev->dev, "Unable to ioremap CSI2 registers.\n"); - return -ENXIO; - } + priv->base = devm_ioremap_resource(&pdev->dev, res); + if (IS_ERR(priv->base)) + return PTR_ERR(priv->base); priv->pdev = pdev; platform_set_drvdata(pdev, priv);