Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932970AbZLNXWs (ORCPT ); Mon, 14 Dec 2009 18:22:48 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932959AbZLNXWo (ORCPT ); Mon, 14 Dec 2009 18:22:44 -0500 Received: from exprod6og107.obsmtp.com ([64.18.1.208]:58933 "EHLO exprod6og107.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932962AbZLNXWm convert rfc822-to-8bit (ORCPT ); Mon, 14 Dec 2009 18:22:42 -0500 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT Subject: [PATCH] ehci-au1xxx.c: use platform_get_resource() and resource_size() Date: Mon, 14 Dec 2009 18:22:42 -0500 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH] ehci-au1xxx.c: use platform_get_resource() and resource_size() Thread-Index: Acp9FFWuqLpx23XwQbiwZNmsQbEdCA== From: "H Hartley Sweeten" To: "kernel list" , Cc: "David Woodhouse" X-OriginalArrivalTime: 14 Dec 2009 23:22:40.0001 (UTC) FILETIME=[54438710:01CA7D14] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1328 Lines: 37 Use platform_get_resource() to fetch the memory resource and resource_size() for calculate the length. Signed-off-by: H Hartley Sweeten Cc: David Brownell --- diff --git a/drivers/usb/host/ehci-au1xxx.c b/drivers/usb/host/ehci-au1xxx.c index ed77be7..987e1ed 100644 --- a/drivers/usb/host/ehci-au1xxx.c +++ b/drivers/usb/host/ehci-au1xxx.c @@ -121,6 +121,7 @@ static int ehci_hcd_au1xxx_drv_probe(struct platform_device *pdev) { struct usb_hcd *hcd; struct ehci_hcd *ehci; + struct resource *res; int ret; if (usb_disabled()) @@ -144,8 +145,9 @@ static int ehci_hcd_au1xxx_drv_probe(struct platform_device *pdev) if (!hcd) return -ENOMEM; - hcd->rsrc_start = pdev->resource[0].start; - hcd->rsrc_len = pdev->resource[0].end - pdev->resource[0].start + 1; + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + hcd->rsrc_start = res->start; + hcd->rsrc_len = resource_size(res); if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, hcd_name)) { pr_debug("request_mem_region failed"); -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/