Commit fcead843 authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Felipe Balbi

usb: isp1760: Retrieve pdev memory resource from hcd at remove time

The platform driver remove function needs to release the memory resource
requested at probe time. Instead of retrieving the resource from the
platform device, retrieve it from the usb_hcd. This mimics the behaviour
of the PCI and OF glues, and will make it easier to share code between
all three glue layers.
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: default avatarFelipe Balbi <balbi@ti.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 8a8b96f4
......@@ -373,15 +373,11 @@ static int isp1760_plat_probe(struct platform_device *pdev)
static int isp1760_plat_remove(struct platform_device *pdev)
{
struct resource *mem_res;
resource_size_t mem_size;
struct usb_hcd *hcd = platform_get_drvdata(pdev);
usb_remove_hcd(hcd);
mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
mem_size = resource_size(mem_res);
release_mem_region(mem_res->start, mem_size);
release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
usb_put_hcd(hcd);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment