lkml.org 
[lkml]   [2016]   [Jun]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v9 5/5] usb: dwc3: core: cleanup IRQ resources
Date

Hi,

Roger Quadros <rogerq@ti.com> writes:
> On 10/06/16 11:18, Felipe Balbi wrote:
>>
>> Hi,
>>
>> Roger Quadros <rogerq@ti.com> writes:
>>>> dwc->xhci_resource[1] = *res;
>>>
>>> Probably not as we don't want to change parent/child members.
>>
>> oh, you had already replied. Sorry. This is correct
>>
> np :).
>
> So what i'll do is get the irq via platform_get_irq() and friends
> and if it was a success use platform_get_resource() and friends
> to get struct resource and just edit the relevant parts for the
> XHCI irq resource.
>
> Sounds OK?
>
> something like this.
>
> + int ret, irq;
> + struct resource *res;
> + struct platform_device *dwc3_pdev = to_platform_device(dwc->dev);
> +
> + irq = platform_get_irq_byname(dwc3_pdev, "host");
> + if (irq == -EPROBE_DEFER)
> + return irq;
> +
> + if (irq <= 0) {
> + irq = platform_get_irq_byname(dwc3_pdev, "dwc_usb3");
> + if (irq == -EPROBE_DEFER)
> + return irq;
> +
> + if (irq <= 0) {
> + irq = platform_get_irq(dwc3_pdev, 0);
> + if (irq <= 0) {
> + if (irq != -EPROBE_DEFER) {
> + dev_err(dwc->dev,
> + "missing host IRQ\n");
> + }
> + return irq;
> + } else {
> + res = platform_get_resource(dwc3_pdev,
> + IORESOURCE_IRQ, 0);
> + }
> + } else {
> + res = platform_get_resource_byname(dwc3_pdev,
> + IORESOURCE_IRQ,
> + "dwc_usb3");
> + }
> +
> + } else {
> + res = platform_get_resource_byname(dwc3_pdev, IORESOURCE_IRQ,
> + "host");
> + }
> +
> + dwc->xhci_resources[1].start = irq;
> + dwc->xhci_resources[1].end = irq;
> + dwc->xhci_resources[1].flags = res->flags;
> + dwc->xhci_resources[1].name = res->name;

looks okay to me.

--
balbi
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2016-06-10 11:41    [W:0.078 / U:0.284 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site