From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754131AbbIBPJz (ORCPT ); Wed, 2 Sep 2015 11:09:55 -0400 Received: from metis.ext.pengutronix.de ([92.198.50.35]:42191 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750856AbbIBPJx (ORCPT ); Wed, 2 Sep 2015 11:09:53 -0400 Message-ID: <1441206592.3279.45.camel@pengutronix.de> Subject: Re: [PATCH] reset: Fix of_reset_control_get() for consistent return values From: Philipp Zabel To: Alban Bedel Cc: linux-kernel@vger.kernel.org Date: Wed, 02 Sep 2015 17:09:52 +0200 In-Reply-To: <1441121311-31628-1-git-send-email-albeu@free.fr> References: <1441121311-31628-1-git-send-email-albeu@free.fr> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.12.9-1+b1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 2001:67c:670:100:96de:80ff:fec2:9969 X-SA-Exim-Mail-From: p.zabel@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Alban, Am Dienstag, den 01.09.2015, 17:28 +0200 schrieb Alban Bedel: > When of_reset_control_get() is called without connection ID it returns > -ENOENT when the 'resets' property doesn't exists or is an empty entry. > However when a connection ID is given it returns -EINVAL when the 'resets' > property doesn't exists or the requested name can't be found. This is > because the error code returned by of_property_match_string() is just > passed down as an index to of_parse_phandle_with_args(), which then > returns -EINVAL. Is that true? As far as I can see, since commit bd69f73f2c81 ("of: Create function for counting number of phandles in a property") it returns the (positive) number of entries if index is negative and the 'resets' property exists and parses correctly (before it would return -ENOENT). If there are parsing errors, it can also return -EINVAL. regards Philipp