From patchwork Mon May 6 02:40:11 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: NeilBrown X-Patchwork-Id: 2521761 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id D462A3FC5A for ; Mon, 6 May 2013 02:40:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752094Ab3EFCkd (ORCPT ); Sun, 5 May 2013 22:40:33 -0400 Received: from cantor2.suse.de ([195.135.220.15]:33629 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751973Ab3EFCkd (ORCPT ); Sun, 5 May 2013 22:40:33 -0400 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id A8119A51FF; Mon, 6 May 2013 04:40:31 +0200 (CEST) Date: Mon, 6 May 2013 12:40:11 +1000 From: NeilBrown To: Tony Lindgren Cc: Russell King - ARM Linux , Eduardo Valentin , Arnd Bergmann , Nicolas Pitre , linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: Latest build results - errors/warnings - lots of them Message-ID: <20130506124011.7e4c2806@notabene.brown> In-Reply-To: <20130502153834.GR28721@atomide.com> References: <20130430081739.GP14496@n2100.arm.linux.org.uk> <20130502082218.GA21614@n2100.arm.linux.org.uk> <20130502153834.GR28721@atomide.com> X-Mailer: Claws Mail 3.9.0 (GTK+ 2.24.14; x86_64-suse-linux-gnu) Mime-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org On Thu, 2 May 2013 08:38:34 -0700 Tony Lindgren wrote: > > drivers/power/twl4030_charger.c: In function 'twl4030_charger_enable_usb': > > drivers/power/twl4030_charger.c:192:20: warning: ignoring return value of 'regulator_enable', declared with attribute warn_unused_result > > Neil, care to provide a fix for this? It's from your commit ab37813 > (twl4030_charger: Allow charger to control the regulator that feeds it). > > This the sort of thing that might be appropriate? NeilBrown From: NeilBrown Date: Mon, 6 May 2013 12:35:59 +1000 Subject: [PATCH] twl4030_charger: don't ignore regulator_enable() regulator_enable() doesn't like being ignored. If it does fail there is nothing we can do except not set usb_enabled (which is necessary else a subsequent regulator_disable() will be unbalanced). We cannot usefully return an error here as errors from twl4030_charger_enable_usb() are ignored. Signed-off-by: NeilBrown diff --git a/drivers/power/twl4030_charger.c b/drivers/power/twl4030_charger.c index bed4581..8b0ec70 100644 --- a/drivers/power/twl4030_charger.c +++ b/drivers/power/twl4030_charger.c @@ -189,8 +189,8 @@ static int twl4030_charger_enable_usb(struct twl4030_bci *bci, bool enable) /* Need to keep regulator on */ if (!bci->usb_enabled) { - regulator_enable(bci->usb_reg); - bci->usb_enabled = 1; + if (regulator_enable(bci->usb_reg) == 0) + bci->usb_enabled = 1; } /* forcing the field BCIAUTOUSB (BOOT_BCI[1]) to 1 */