Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1f141ca2 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman
Browse files

USB: ehci-au1xxx.c: use platform_get_resource() and resource_size()



Use platform_get_resource() to fetch the memory resource and
resource_size() for calculate the length.

Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent f65c3540
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -121,6 +121,7 @@ static int ehci_hcd_au1xxx_drv_probe(struct platform_device *pdev)
{
{
	struct usb_hcd *hcd;
	struct usb_hcd *hcd;
	struct ehci_hcd *ehci;
	struct ehci_hcd *ehci;
	struct resource *res;
	int ret;
	int ret;


	if (usb_disabled())
	if (usb_disabled())
@@ -144,8 +145,9 @@ static int ehci_hcd_au1xxx_drv_probe(struct platform_device *pdev)
	if (!hcd)
	if (!hcd)
		return -ENOMEM;
		return -ENOMEM;


	hcd->rsrc_start = pdev->resource[0].start;
	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
	hcd->rsrc_len = pdev->resource[0].end - pdev->resource[0].start + 1;
	hcd->rsrc_start = res->start;
	hcd->rsrc_len = resource_size(res);


	if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, hcd_name)) {
	if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, hcd_name)) {
		pr_debug("request_mem_region failed");
		pr_debug("request_mem_region failed");