From patchwork Wed Jul 25 12:05:28 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 1237071 Return-Path: X-Original-To: patchwork-linux-omap@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 DDC7D3FDFB for ; Wed, 25 Jul 2012 12:10:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932906Ab2GYMKQ (ORCPT ); Wed, 25 Jul 2012 08:10:16 -0400 Received: from na3sys009aog112.obsmtp.com ([74.125.149.207]:36639 "EHLO na3sys009aog112.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932930Ab2GYMIw (ORCPT ); Wed, 25 Jul 2012 08:08:52 -0400 Received: from mail-lb0-f182.google.com ([209.85.217.182]) (using TLSv1) by na3sys009aob112.postini.com ([74.125.148.12]) with SMTP ID DSNKUA/h0WYPHlGxPox5OZ9rDu4E0363c5CA@postini.com; Wed, 25 Jul 2012 05:08:51 PDT Received: by lbon10 with SMTP id n10so1023875lbo.27 for ; Wed, 25 Jul 2012 05:08:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=P/CBEqALHCi69cGbVaW34Xe4Bd+5dyPYdj+PVxxkm38=; b=lsmDMYkWKSeEN2KtQOmEN9apKl2RkmSn4kUS2Xmrac9etBpbeLEpBkobOkJaVn2iHB 74507SFatn6fFmlaFVVdkmscJX3uwZhhj3oKR6B2kO6gRe/W3ek4SE34H3Nh1PAAqDEU Y6WAlscReglkYLlyHN4gm/ayliWAiG64nK2U2wmmVxLmbCGfVBcVLztb9zm2sT/IxtwF Fx9ZMfQyi1GrWSLbC91L7jCWFf/2OCmAGq5BOvfhKALgg+n6FXnHO82MJ2XAnFMq9gAB WX2M9LjA/qLSOWgOHKgTH2dQcor2zQsBjEyTeJ0wwXrWaS2U99b5cHFEsRlh5StJm3Bu GwVw== Received: by 10.112.103.135 with SMTP id fw7mr11597785lbb.25.1343218128136; Wed, 25 Jul 2012 05:08:48 -0700 (PDT) Received: from localhost (cs78217178.pp.htv.fi. [62.78.217.178]) by mx.google.com with ESMTPS id d3sm4542602lbh.3.2012.07.25.05.08.46 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 25 Jul 2012 05:08:47 -0700 (PDT) From: Felipe Balbi To: zbr@ioremap.net Cc: Linux Kernel Mailing List , Linux OMAP Mailing List , Felipe Balbi Subject: [PATCH 2/6] w1: omap-hdq: don't hardcode resource size Date: Wed, 25 Jul 2012 15:05:28 +0300 Message-Id: <1343217932-25372-2-git-send-email-balbi@ti.com> X-Mailer: git-send-email 1.7.11 In-Reply-To: <1343217932-25372-1-git-send-email-balbi@ti.com> References: <1343217932-25372-1-git-send-email-balbi@ti.com> X-Gm-Message-State: ALoCoQk5mFixijy1OX9PvO6pKMlmJpaRFx1xCd3Mbpm76n7P40KaSBEOwSaOYnsfhNmnDyvy5XJi Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org we have the helpful resource_size() macro to calculate the size of the memory resource for us, let's use it. Signed-off-by: Felipe Balbi --- drivers/w1/masters/omap_hdq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/w1/masters/omap_hdq.c b/drivers/w1/masters/omap_hdq.c index 46e1f6f..404a4de 100644 --- a/drivers/w1/masters/omap_hdq.c +++ b/drivers/w1/masters/omap_hdq.c @@ -568,7 +568,7 @@ static int __devinit omap_hdq_probe(struct platform_device *pdev) goto err_resource; } - hdq_data->hdq_base = ioremap(res->start, SZ_4K); + hdq_data->hdq_base = ioremap(res->start, resource_size(res)); if (!hdq_data->hdq_base) { dev_dbg(&pdev->dev, "ioremap failed\n"); ret = -EINVAL;