Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp899388pxb; Tue, 1 Feb 2022 12:45:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJxN+88fC2rmD1JieP68zjMt/Kny0/PZXaFhX7Zo0UXi/rv0K+cVrrsASMaszC39KyDUm3VV X-Received: by 2002:a17:90b:1b04:: with SMTP id nu4mr4383967pjb.137.1643748303299; Tue, 01 Feb 2022 12:45:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643748303; cv=none; d=google.com; s=arc-20160816; b=QC2CdkI2Budy5cS5YU7iAtLL8ZufuesUS5afsCQ1evvMmU3ttL09fUuzpPrVgsV9ft 1fW/cIA6qymxx3GETozuV0RUJEUkSvH8HfOIWDhO1pkyLcZNki+BWMWDIjbk7UQ14l5I 8BEG/U9JnMLJKXo1AtNJ5kH1w16D4WS/2EKDHXxpGecT/bwPYTBnjO5mxTrT8p+tJqYM QB/2mT97uJKcNyL1rw7hPczYaGZZX9RWOmCs9sirHPTuUXbUcmD0wSrHFs2vtJM8ZSqg FEBqptNfJgsx+mKf9ulemrbUXZL/q1ncHp9sLQ8BmqlTRhfmhlIuQeHYntKjH4v28QSe yyyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=Tm7F3YhlCjAzhm/gLZLF+Nk5LaALVqnFHVkjb+16BUQ=; b=JQ2e3uBgA44hbcem2jz3dHz6SRtutSOw7bbHxarCNTvpcRoV+bF5zHCGS1oal6aRIt jLHVsUCIlNzpvEs8gmX5+Qa8R8flW652els32SKjed8iD5BpMu9yAgkPc/aXA2ayBX26 HgAou9v/0qteQ1/5CjNTzZrZxHVAkHHvHKypPNsxL6c19nWwd+dAWVip2JuwuTnSQQnr UwXz5tf4gbps30Cmt6KjhqIFY6nql+AiRNRqHUVGsGASzyY2fXnCHJKOaMfZtce7Was0 7mfsP79e8uJ8t7bicihxS1idLAueXC6vAvKH0bB9FA8/zGgclZ+rv8MAnidF355Kvquo wrCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=EoE5yYS+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f8si17361286pgs.375.2022.02.01.12.44.51; Tue, 01 Feb 2022 12:45:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=EoE5yYS+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1380267AbiAaQVa (ORCPT + 99 others); Mon, 31 Jan 2022 11:21:30 -0500 Received: from mga01.intel.com ([192.55.52.88]:13463 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1380116AbiAaQVW (ORCPT ); Mon, 31 Jan 2022 11:21:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1643646082; x=1675182082; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=r4B9aWmQfZmAaLbnAQfzd6iHm0LZz0ye6Jl1awPoYCg=; b=EoE5yYS+QdBksyJd8PQKO3R2+BegmG94DXYMrjmG2VYfiuu9IXrihrOZ SoZORi4QrRCVl+zQ84UCq4fqXqkG34qNA3VYEKEPzA2752odt3AVxVuEp CALNZFezIgCpfWL8P01Gaori3g7MyvrF1wfhP8Gp+bymD+loIyL1to79t WMeHbgtW1E+j03AmmlwnBf97uM4x8zd9vJkfX103xIsYOEW1lnhyG2nRG gikvS7u926HOd9AMOMUnQuRlIaDwF3d5mJ5BLWVZyuzBadYKoVN5pAifX dZGOU3D6Mc8NRgiOw1zRkhDu6jGTERtF5iGhTIrEeAbsfeyWbRyEYSoeK A==; X-IronPort-AV: E=McAfee;i="6200,9189,10244"; a="271966417" X-IronPort-AV: E=Sophos;i="5.88,331,1635231600"; d="scan'208";a="271966417" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jan 2022 08:20:56 -0800 X-IronPort-AV: E=Sophos;i="5.88,331,1635231600"; d="scan'208";a="565181799" Received: from smile.fi.intel.com ([10.237.72.61]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jan 2022 08:20:51 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.95) (envelope-from ) id 1nEZPA-00Gw7r-2E; Mon, 31 Jan 2022 18:19:48 +0200 Date: Mon, 31 Jan 2022 18:19:47 +0200 From: Andy Shevchenko To: Hans de Goede Cc: "Rafael J . Wysocki" , Mika Westerberg , Mark Gross , Andy Shevchenko , Wolfram Sang , Lee Jones , Sebastian Reichel , MyungJoo Ham , Chanwoo Choi , Ard Biesheuvel , Len Brown , linux-acpi@vger.kernel.org, Yauhen Kharuzhy , Tsuchiya Yuto , Fabio Aiuto , platform-driver-x86@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org Subject: Re: [PATCH v4 12/20] power: supply: bq25890: Support higher charging voltages through Pump Express+ protocol Message-ID: References: <20220130204557.15662-1-hdegoede@redhat.com> <20220130204557.15662-13-hdegoede@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 31, 2022 at 04:18:23PM +0100, Hans de Goede wrote: > On 1/31/22 14:48, Andy Shevchenko wrote: > > On Sun, Jan 30, 2022 at 09:45:49PM +0100, Hans de Goede wrote: ... > >> + for (i = 0; i < PUMP_EXPRESS_MAX_TRIES; i++) { > > > >> + voltage = bq25890_get_vbus_voltage(bq); > >> + if (voltage < 0) > >> + goto error_print; > > > > It also can be (at least in align with the rest error paths) > > > > ret = bq25890_get_vbus_voltage(bq); > > if (ret < 0) > > goto error_print; > > voltage = ret; > > > > followed up (but not necessarily)... > > The suggested pattern is useful when ret needs to be set on the error-exit > path, but we are not doing that here. So I prefer to just keep this as is. Are you talking about above proposal? Still wouldn't be better to use it that if we want, for example, to print an error code, it can be done easily? For the sake of consistency. > >> + } > >> + > >> + bq25890_field_write(bq, F_PUMPX_EN, 0); > >> + > >> + dev_info(bq->dev, "Hi-voltage charging requested, input voltage is %d mV\n", > >> + voltage); > > > >> + return; > >> +error_print: > > > > if (ret < 0) > > > > But it's up to you. > > > >> + dev_err(bq->dev, "Failed to request hi-voltage charging\n"); -- With Best Regards, Andy Shevchenko