From mboxrd@z Thu Jan 1 00:00:00 1970 From: Javier Martinez Canillas Subject: Re: [PATCH v5 5/5] regulator: of: Add support for parsing initial and suspend modes Date: Fri, 07 Nov 2014 17:15:38 +0100 Message-ID: <545CF02A.9060500@collabora.co.uk> References: <1415365205-27630-1-git-send-email-javier.martinez@collabora.co.uk> <1415365205-27630-6-git-send-email-javier.martinez@collabora.co.uk> <20141107154743.GT8509@sirena.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20141107154743.GT8509-GFdadSzt00ze9xe1eoZjHA@public.gmane.org> Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Mark Brown Cc: Kukjin Kim , Chanwoo Choi , Olof Johansson , Chris Zhong , Krzysztof Kozlowski , Abhilash Kesavan , linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-samsung-soc@vger.kernel.org On 11/07/2014 04:47 PM, Mark Brown wrote: > On Fri, Nov 07, 2014 at 02:00:05PM +0100, Javier Martinez Canillas wrote: > >> + if (!of_property_read_u32(np, "regulator-initial-mode", &pval)) { >> + if (desc && desc->map_modes) >> + constraints->initial_mode = desc->map_modes(pval); >> + else >> + pr_warn("%s: failed to parse regulator-initial-mode\n", >> + np->name); >> + } > > This is ignoring any error return from map_modes(), it's possible the DT > might have an invalid value. The error message could also use some > improvement, it's more that the kernel doesn't understand how to parse > it even if it is valid. > Right, as I mentioned to Krzysztof in a previous email, I'll remove the warning message and add an error message instead if the map mode callback function fails and also show the error code as you suggest. Best regards, Javier -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751852AbaKGQPr (ORCPT ); Fri, 7 Nov 2014 11:15:47 -0500 Received: from bhuna.collabora.co.uk ([93.93.135.160]:44477 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751243AbaKGQPp (ORCPT ); Fri, 7 Nov 2014 11:15:45 -0500 Message-ID: <545CF02A.9060500@collabora.co.uk> Date: Fri, 07 Nov 2014 17:15:38 +0100 From: Javier Martinez Canillas User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.0 MIME-Version: 1.0 To: Mark Brown CC: Kukjin Kim , Chanwoo Choi , Olof Johansson , Chris Zhong , Krzysztof Kozlowski , Abhilash Kesavan , linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: Re: [PATCH v5 5/5] regulator: of: Add support for parsing initial and suspend modes References: <1415365205-27630-1-git-send-email-javier.martinez@collabora.co.uk> <1415365205-27630-6-git-send-email-javier.martinez@collabora.co.uk> <20141107154743.GT8509@sirena.org.uk> In-Reply-To: <20141107154743.GT8509@sirena.org.uk> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/07/2014 04:47 PM, Mark Brown wrote: > On Fri, Nov 07, 2014 at 02:00:05PM +0100, Javier Martinez Canillas wrote: > >> + if (!of_property_read_u32(np, "regulator-initial-mode", &pval)) { >> + if (desc && desc->map_modes) >> + constraints->initial_mode = desc->map_modes(pval); >> + else >> + pr_warn("%s: failed to parse regulator-initial-mode\n", >> + np->name); >> + } > > This is ignoring any error return from map_modes(), it's possible the DT > might have an invalid value. The error message could also use some > improvement, it's more that the kernel doesn't understand how to parse > it even if it is valid. > Right, as I mentioned to Krzysztof in a previous email, I'll remove the warning message and add an error message instead if the map mode callback function fails and also show the error code as you suggest. Best regards, Javier