From mboxrd@z Thu Jan 1 00:00:00 1970 From: Clemens Ladisch Subject: Re: [PATCH - alsa-lib 1/1] Introduce snd_seq_client_info_get_card_number, for getting the card number of a seq client on recent kernels Date: Fri, 05 Jun 2015 08:50:45 +0200 Message-ID: <557146C5.90209@ladisch.de> References: <1433466312-31444-1-git-send-email-agoode@google.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from dehamd003.servertools24.de (dehamd003.servertools24.de [31.47.254.18]) by alsa0.perex.cz (Postfix) with ESMTP id 7B38126672E for ; Fri, 5 Jun 2015 08:50:49 +0200 (CEST) In-Reply-To: <1433466312-31444-1-git-send-email-agoode@google.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Adam Goode Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org Adam Goode wrote: > /** > + * \brief Get the card number of a client_info container > + * \param info client_info container > + * \return the card number, -1 if no card associated with this client, or -ENOSYS if the > + * kernel does not support reporting this field > + */ -1 is used as an out-of-range value when enumerating cards. However, I don't think this convention can be applied here, because the return value is also used for error codes, and -1 would correspond to -EPERM. Squashing all error codes into -1 is not a good idea, so I think the value -1 should be converted into an appropriate error code, probably -ENXIO. Regards, Clemens