From patchwork Sat Jan 29 09:33:48 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: axel lin X-Patchwork-Id: 516381 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p0T9XuqF001772 for ; Sat, 29 Jan 2011 09:33:56 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751596Ab1A2Jdz (ORCPT ); Sat, 29 Jan 2011 04:33:55 -0500 Received: from mail-pw0-f46.google.com ([209.85.160.46]:56892 "EHLO mail-pw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751298Ab1A2Jdy (ORCPT ); Sat, 29 Jan 2011 04:33:54 -0500 Received: by pwj3 with SMTP id 3so766184pwj.19 for ; Sat, 29 Jan 2011 01:33:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:subject:from:to:cc:content-type:date:message-id :mime-version:x-mailer:content-transfer-encoding; bh=dOxuN6pTcbEYiamVINXYWsVfclwhjyuyTCOo7Gg6P1c=; b=HmBCnL5xd97DhOhF+mtXUJHGmbj/ysPmF1gih1Wxb4uXQY2tLMfCuI8g5L9Ww8b9ZH k509VAQxysl6uPD6rOY3X/ykrH5TrZzbvZ3jI7gXnEPzNOKaQoJ8+aPU/SLgbtqrwASR jHQxnrMC6t6YAdileo9qVQe8mKBfp6bUvW1YY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:cc:content-type:date:message-id:mime-version :x-mailer:content-transfer-encoding; b=p+sLTvTWS3BXUpvmOWUhtpteeSocKv3eSLxlu9eHNb5L5IuU6RdFsLWKt/nPRmjZ1c y/FW8+/0uzal8ZiKszjSCexAj8Z2ZSGT/9zhNextC+H5pxeUBMpQewtk5OuNbfRGGfqH 9np+latOmbfvaZ3xV5reRj2jc2ngIOCf40TME= Received: by 10.142.156.17 with SMTP id d17mr3988396wfe.442.1296293633987; Sat, 29 Jan 2011 01:33:53 -0800 (PST) Received: from [218.167.73.81] (218-167-73-81.dynamic.hinet.net [218.167.73.81]) by mx.google.com with ESMTPS id y42sm24641240wfd.10.2011.01.29.01.33.50 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 29 Jan 2011 01:33:52 -0800 (PST) Subject: [PATCH 1/2] video: hpfb: use resource_size() From: Axel Lin To: linux-kernel@vger.kernel.org Cc: Phil Blundell , Geert Uytterhoeven , Paul Mundt , linux-fbdev@vger.kernel.org Date: Sat, 29 Jan 2011 17:33:48 +0800 Message-ID: <1296293628.13797.2.camel@phoenix> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Sat, 29 Jan 2011 09:33:56 +0000 (UTC) diff --git a/drivers/video/hpfb.c b/drivers/video/hpfb.c index c8e280f..ebf8495 100644 --- a/drivers/video/hpfb.c +++ b/drivers/video/hpfb.c @@ -321,11 +321,11 @@ static int __devinit hpfb_dio_probe(struct dio_dev * d, const struct dio_device_ unsigned long paddr, vaddr; paddr = d->resource.start; - if (!request_mem_region(d->resource.start, d->resource.end - d->resource.start, d->name)) + if (!request_mem_region(d->resource.start, resource_size(&d->resource), d->name)) return -EBUSY; if (d->scode >= DIOII_SCBASE) { - vaddr = (unsigned long)ioremap(paddr, d->resource.end - d->resource.start); + vaddr = (unsigned long)ioremap(paddr, resource_size(&d->resource)); } else { vaddr = paddr + DIO_VIRADDRBASE; } @@ -344,7 +344,7 @@ static void __devexit hpfb_remove_one(struct dio_dev *d) unregister_framebuffer(&fb_info); if (d->scode >= DIOII_SCBASE) iounmap((void *)fb_regs); - release_mem_region(d->resource.start, d->resource.end - d->resource.start); + release_mem_region(d->resource.start, resource_size(&d->resource)); } static struct dio_device_id hpfb_dio_tbl[] = {