Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966134Ab3HHSpe (ORCPT ); Thu, 8 Aug 2013 14:45:34 -0400 Received: from avon.wwwdotorg.org ([70.85.31.133]:45323 "EHLO avon.wwwdotorg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966070Ab3HHSpc (ORCPT ); Thu, 8 Aug 2013 14:45:32 -0400 Message-ID: <5203E748.2050601@wwwdotorg.org> Date: Thu, 08 Aug 2013 12:45:28 -0600 From: Stephen Warren User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130803 Thunderbird/17.0.8 MIME-Version: 1.0 To: Guenter Roeck CC: Wei Ni , "khali@linux-fr.org" , Matthew Longnecker , "linux-arm-kernel@lists.infradead.org" , "lm-sensors@lm-sensors.org" , "linux-kernel@vger.kernel.org" , "linux-tegra@vger.kernel.org" Subject: Re: [PATCH v2 1/3] hwmon: (lm90) Add power control References: <1375944991-29182-1-git-send-email-wni@nvidia.com> <1375944991-29182-2-git-send-email-wni@nvidia.com> <520359E9.1000600@roeck-us.net> <52036920.4050808@nvidia.com> <52037F9A.7070802@roeck-us.net> <5203D659.4050907@wwwdotorg.org> <20130808175918.GA15013@roeck-us.net> In-Reply-To: <20130808175918.GA15013@roeck-us.net> X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1231 Lines: 36 On 08/08/2013 11:59 AM, Guenter Roeck wrote: > On Thu, Aug 08, 2013 at 11:33:13AM -0600, Stephen Warren wrote: >> On 08/08/2013 05:23 AM, Guenter Roeck wrote: >>> On 08/08/2013 02:47 AM, Wei Ni wrote: >> ... >>>> I think get_regulator() will return error values, not only >>>> -EPROBE_DEFER, so we should set data->lm90_reg to NULL to handle other >>>> error values. >>>> >>> Matter of opinion if you want to check for IS_ERR or NULL later on. >> >> No, if regulator returns either: >> >> * Something valid >> * Someting IS_ERR() >> >> ... then everywhere has to check the value using IS_ERR(). >> >> If regulator returns either: >> >> * Something valid >> * Someting NULL >> >> ... then everywhere has to check the value against NULL. >> > Other drivers calling get_regulator() don't check against NULL, > so it should not be needed here either. Right I should have mentioned that I believe regulator falls into the first valid-or-IS_ERR case, and not the second valid-or-NULL case. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/