From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lee Revell Subject: Re: [alsa-cvslog] CVS: alsa-kernel/usb usbaudio.c,1.172,1.173 Date: Thu, 09 Mar 2006 16:49:46 -0500 Message-ID: <1141940987.13319.71.camel@mindpipe> References: Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: Clemens Ladisch Cc: alsa-devel , linux-kernel List-Id: alsa-devel@alsa-project.org On Wed, 2006-03-08 at 23:58 -0800, Clemens Ladisch wrote: > +static const char *usb_error_string(int err) > +{ > + switch (err) { > + case -ENODEV: > + return "no device"; > + case -ENOENT: > + return "endpoint not enabled"; > + case -EPIPE: > + return "endpoint stalled"; > + case -ENOSPC: > + return "not enough bandwidth"; > + case -ESHUTDOWN: > + return "device disabled"; > + case -EHOSTUNREACH: > + return "device suspended"; > + case -EINVAL: > + case -EAGAIN: > + case -EFBIG: > + case -EMSGSIZE: > + return "internal error"; > + default: > + return "unknown error"; > + } > +} Shouldn't a generic facility be created for this? After all these are standard error codes and it seem like other parts of the kernel might want to do user friendly error reporting. Lee