Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755604AbaBUOoF (ORCPT ); Fri, 21 Feb 2014 09:44:05 -0500 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:52210 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753830AbaBUOoD (ORCPT ); Fri, 21 Feb 2014 09:44:03 -0500 Date: Fri, 21 Feb 2014 15:44:00 +0100 From: Pavel Machek To: Jenny Tc Cc: linux-kernel@vger.kernel.org, Dmitry Eremin-Solenikov , Anton Vorontsov , Anton Vorontsov , Kim Milo , Lee Jones , Jingoo Han , Chanwoo Choi , Sachin Kamat , Lars-Peter Clausen , Pali =?iso-8859-1?Q?Roh=E1r?= , Rhyland Klein , "Rafael J. Wysocki" , David Woodhouse , Tony Lindgren , Russell King , Sebastian Reichel , aaro.koskinen@iki.fi, Pallala Ramakrishna , freemangordon@abv.bg, linux-omap@vger.kernel.org Subject: Re: [PATCH 4/4] power_supply: bq24261 charger driver Message-ID: <20140221144400.GA5238@amd.pavel.ucw.cz> References: <1391490780-6141-1-git-send-email-jenny.tc@intel.com> <1391490780-6141-5-git-send-email-jenny.tc@intel.com> <20140204113621.GB2450@amd.pavel.ucw.cz> <20140220050310.GA2498@jenny-desktop> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140220050310.GA2498@jenny-desktop> User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi! > > > +static inline int bq24261_set_cv(struct bq24261_charger *chip, int cv) > > > +{ > > > + int bat_volt; > > > + int ret; > > > + u8 reg_val; > > > + u8 vindpm_val = 0x0; > > > + > > > + /* > > > + * Setting VINDPM value as per the battery voltage > > > + * VBatt Vindpm Register Setting > > > + * < 3.7v 4.2v 0x0 (default) > > > + * 3.71v - 3.96v 4.36v 0x2 > > > + * > 3.96v 4.6v 0x5 > > > + */ > > > + ret = get_battery_voltage(&bat_volt); > > > + if (ret) { > > > + dev_err(&chip->client->dev, > > > + "Error getting battery voltage!!\n"); > > > + } else { > > > > You forget the error value and continue anyway. > > On error, throw the error and program default VINDPM value. Is it good idea to attempt charging when we can't read battery voltage? Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html -- 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/