Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1495785pxb; Sat, 30 Oct 2021 15:11:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxyoDAr1Ct7cexd9kG7nmO4Kln0ONDdwP/Er1E9auh7OTS3BF+q2GIRkoro04oQFFxBtQ/w X-Received: by 2002:a5d:9416:: with SMTP id v22mr13708535ion.96.1635631908290; Sat, 30 Oct 2021 15:11:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635631908; cv=none; d=google.com; s=arc-20160816; b=eXtNySyZH93IaItxjI3wDtIEXdp2Ls6DDzlbFkIhYG/wxYgUSXack3SYRiNraiea8m k/HwN5B+W1YYcQD7whRtqQkzkNYKWcxm16nyIPgKlZj0ZZdB6namNnzT2ZQUfVYRAOyp ejD6h56OnZ6aHA7e9XUHIpdwGAYOR/a9V0/Dn4wxPhP0mFQuVU+FsDGIivxxgY5P9SDL 3uUAJ0/06Tzn40bwwH4Hq3nH4GrXm5kmocPmLSmy4Wo5RrofUqhxhtr1ZlQdldKfPYkI OVzcBny2LnUsNaBlkCUXkVYqiAege8HId+QvLG8y6EMk2poR8IfJRjYAo7+D4bwUmvBR 24qA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=Op3eI1JHXwzcqHAY7sxmXFKCkDFAklic1E73M/hLzFE=; b=aq+cLmQ4eZen10tEDKo7ZFO/Og7Q/jwQefUh9heej4OVEDQCsXekmckef7mDmNTh6S AJjgEKiSEipYJ9WlCrf9MtVmCnGGOfdlX9HQcH5caLRWnrxBmUPAzW7l5d+0HfjoTwgx P16KDgpQZ5trKEHkm0xL7ThT7zUFY723EoSlGEbf0EQhj1aC1Cv/6sNCabmgFrR4Fxd2 cQ3fdAOt5gc+EUySpMZlbksd0nYEv/g2Dx94bMfrT7M4oo3YXRsEwOz6COGWVEo0kaX7 3AnhOY9qcHgPIPJ8K0RBN8tZnDISdNzIi/1y+pn9lt3yvEOYsHqpJDtBmZJcjQsmYFLE lFFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=qwrbaCEz; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 64si9951568jaf.28.2021.10.30.15.11.36; Sat, 30 Oct 2021 15:11:48 -0700 (PDT) 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=@gmail.com header.s=20210112 header.b=qwrbaCEz; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231902AbhJ3WNO (ORCPT + 99 others); Sat, 30 Oct 2021 18:13:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230323AbhJ3WNN (ORCPT ); Sat, 30 Oct 2021 18:13:13 -0400 Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D071DC061570; Sat, 30 Oct 2021 15:10:42 -0700 (PDT) Received: by mail-ed1-x532.google.com with SMTP id m17so49621675edc.12; Sat, 30 Oct 2021 15:10:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Op3eI1JHXwzcqHAY7sxmXFKCkDFAklic1E73M/hLzFE=; b=qwrbaCEzsVB+8ini8aiFgRYsWH2zxfMu3mxlq5aXlOTNUQF/JTKC6F9FFC3nA46q6f BnTtynveL7MlmwuXCiLrC32VaxfakmvuJA8WJzcAivsBzKB7xvyCB9BCdGKlExklTiDz 4UinqmctC00yKKHdCd1gTHDyv6f3SyDziyLXLLjbzpKlCqxnFytTefKJtPxhOFGUCU+S slnO1cb1fQB4wiP5aJjcvl68GKgDvmn6xjhDzvOXJEAREFNpWgxlaI5HL1it5hTxgHUD R+2jAPrzjwJDjW/keDGRv0/tgoOMuaMPuA7HG9lxEFLGnYht1H7Y6JTueBJHEi1gG7fd 76mQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Op3eI1JHXwzcqHAY7sxmXFKCkDFAklic1E73M/hLzFE=; b=Dl3jvdv7/JM6/PGink4/jIALIvRzt7PC0qNmJv+nNw/Ii9N8Lz2a3yuvvI4t+W0Jh7 77/l+NSw/4gTXBhqreJut7zWFo5ViIxK757YGPvU3y9xuEsOTxXkJIXan7hV0tJJmiOO dMS0exY14wcZbChxm8WFTpCtElG2NeJAvd9A0VoPnjUmsd9Mm62sPZp5GenkiRsz84Ev lAvwZXQ2wtOudCosA2dek7AYdeoUaC8JIIM+TDJgk6RriItUCzHoa05y8GRWgD7bFC8T DTbTouPToPqlzD/J7skHgukhoYz/6GtM9KQ/QQLZpq47NN7r8C7ohgDOac+etBwU8xi4 UGXw== X-Gm-Message-State: AOAM533tamVDlYpsgfQHmnXxqe6pAZ4HRhTFTMxQrfIZkr6LX9Wv1a+z Xu73z+wzBQft/BWO2apDgXJJevE9BFu29X3eW8s= X-Received: by 2002:aa7:cb09:: with SMTP id s9mr27472809edt.359.1635631841220; Sat, 30 Oct 2021 15:10:41 -0700 (PDT) MIME-Version: 1.0 References: <20211030182813.116672-1-hdegoede@redhat.com> <20211030182813.116672-10-hdegoede@redhat.com> In-Reply-To: <20211030182813.116672-10-hdegoede@redhat.com> From: Andy Shevchenko Date: Sun, 31 Oct 2021 01:10:05 +0300 Message-ID: Subject: Re: [PATCH 09/13] power: supply: bq25890: Add bq25890_set_otg_cfg() helper To: Hans de Goede Cc: Mark Gross , Andy Shevchenko , Wolfram Sang , Sebastian Reichel , MyungJoo Ham , Chanwoo Choi , Ard Biesheuvel , Yauhen Kharuzhy , Tsuchiya Yuto , Platform Driver , linux-i2c , Linux PM , Linux Kernel Mailing List , linux-efi Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Oct 30, 2021 at 9:28 PM Hans de Goede wrote: > > Add a bq25890_set_otg_cfg() helper function, this is a preparation > patch for adding regulator support. ... > switch (bq->usb_event) { > case USB_EVENT_ID: > /* Enable boost mode */ > - ret = bq25890_field_write(bq, F_OTG_CFG, 1); > - if (ret < 0) > - goto error; > + bq25890_set_otg_cfg(bq, 1); > break; > > case USB_EVENT_NONE: > /* Disable boost mode */ > - ret = bq25890_field_write(bq, F_OTG_CFG, 0); > - if (ret < 0) > - goto error; > - > - power_supply_changed(bq->charger); > + ret = bq25890_set_otg_cfg(bq, 0); > + if (ret == 0) > + power_supply_changed(bq->charger); > break; > } While at it, default: break; ? -- With Best Regards, Andy Shevchenko