Re: [PATCH v1] USB: musb: defer probe if transceiver is not ready

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

 



On Thu, Nov 22, 2012 at 07:56:44AM +0200, Felipe Balbi wrote:
> > >         /* dma address for sync dma */
> > >         mem = platform_get_resource(pdev, IORESOURCE_MEM, 1);
> > >         if (!mem) {
> > >                 pr_debug("no sync dma resource?\n");
> > >                 ret = -ENODEV;
> > 
> > Also I am not sure if it is a proper error code for this case, maybe EINVAL
> > is better.
> 
> -ENOMEM sounds more correct to me.

No, please don't try to match the current error to the best matching errno
code available. ENOMEM is when you run out of memory. Here you don't have a
memory address which means your input parameter is wrong (aka EINVAL). You
could argue about ENXIO but EINVAL fits well in this kind of situations

Sebastian
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

  Powered by Linux