Re: question about drivers/usb/gadget/at91_udc.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Sat, Feb 18, 2012 at 06:04:39PM +0100, Julia Lawall wrote:
> The function at91udc_probe in the file drivers/usb/gadget/at91_udc.c
> contains the following code:
> 
>         udc->iclk = clk_get(dev, "udc_clk");
>         udc->fclk = clk_get(dev, "udpck");
>         if (IS_ERR(udc->iclk) || IS_ERR(udc->fclk)) {
>                 DBG("clocks missing\n");
> 		retval = -ENODEV;
>                 /* NOTE: we "know" here that refcounts on these are NOPs */
>                 goto fail0b;
>         }
> 
> Why is it known here that refcounts are NOPs.  When does this
> property cease to hold?  clk_put is present in the corresponding
> remove function.

I guess we need to ask AT91 maintainers as I have never worked with that
architecture, but I believe that if clk_get() fails, the clk won't get
its reference counter incremented. It depends on how they have
implemented their clk API.

-- 
balbi

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux