"Gopinath, Thara" <[email protected]> writes:

[...]

>>>>  /* PM Debug Fs enteries to enable disable smartreflex.*/
>>>> @@ -448,6 +551,7 @@ static int __devinit omap_smartreflex_probe(struct 
>>>> platform_device *pdev)
>>>>     if (odev->hwmods[0]->mpu_irqs)
>>>>             sr_info->irq = odev->hwmods[0]->mpu_irqs[0].irq;
>>>>     sr_set_clk_length(sr_info);
>>>> +   sr_set_regfields(sr_info);
>>>>
>>>>     /* Create the debug fs enteries */
>>>>     sprintf(name, "sr%d_autocomp", sr_info->srid);
>>>> @@ -456,8 +560,29 @@ static int __devinit omap_smartreflex_probe(struct 
>>>> platform_device *pdev)
>>>>
>>>>     odev->hwmods[0]->dev_attr = sr_info;
>>>>     list_add(&sr_info->node, &sr_list);
>>>> -   pr_info("SmartReflex driver initialized\n");
>>>>
>>>> +   /*
>>>> +    * Register interrrupt handler if smartreflex class driver is already
>>>> +    * registered and has requested for interrupts. This will be attempted
>>>> +    * in the class driver register again if it does not happen here.
>>>> +    */
>>>
>>>Why the duplicate attempts to request_irq()?  Seems like it's only needed
>>>in the register_class hook above.
>
> Duplicate attempt is so that it does not matter whether the class driver gets 
> registered before the smartreflex driver gets registered. So if smartreflex 
> driver gets registered first the request_irq will happen only when class 
> driver gets registered. On the other hand if class driver gets registered 
> first then the request_irq will happen from here. The thing to notice is that 
> there is only a duplicate attempt. Actual double registrations does not 
> happen.

OK, thanks for the clarification.

Then, the two blocks of code that reqest_irq + init_enable should be
combined into a subroutine (with comment) called from both places.
This will help avoid the confusion I had and increase readability.

Kevin

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to