From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2A2DEC43217 for ; Mon, 8 Nov 2021 15:59:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1ADF26134F for ; Mon, 8 Nov 2021 15:59:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241179AbhKHQCK (ORCPT ); Mon, 8 Nov 2021 11:02:10 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:47993 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241136AbhKHQCC (ORCPT ); Mon, 8 Nov 2021 11:02:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1636387158; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0FX33YX3/KEHbRU3d7P7kXufc5u/aEPzAlj6z3nAH7Y=; b=OA/OVwsvnjEs/9wJlkUk6Tmuvemh7MgG3GGAoB2t3jFoeVi/mMHSF7AH0XpKOs7A+67Qoa kX+y+ew94jGo3JcrGoVW3jlhPM0G6qdCRknKP+zENgxoWfHNlIkYXZ5gdB/dZr36chbP79 unXlGaWqlEA9HPuen0a+6vrFrhdKq64= Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-433-qyNxcKjNODmJ7v-B935kew-1; Mon, 08 Nov 2021 10:59:16 -0500 X-MC-Unique: qyNxcKjNODmJ7v-B935kew-1 Received: by mail-ed1-f70.google.com with SMTP id r25-20020a05640216d900b003dca3501ab4so15212667edx.15 for ; Mon, 08 Nov 2021 07:59:16 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=0FX33YX3/KEHbRU3d7P7kXufc5u/aEPzAlj6z3nAH7Y=; b=UXnvx08DBiYvamLOuRAMAeRCLxlsjAr5gaOn+YF/aanx6T+VtFFYI1R46y6WITHoyT Fq8thACVvUvemBwsC/XDV0lXu4bIXYqd8BjofOcMMAEINKwaLo3HINJ/cy6doID8tQSj s9EskpNoSKrbY7LhboMU1dBL2ne+u76QXMUTmn8YnJWnycbf2XdcysJrK4lg2TKZ59qF YirJjYkJ5xGmvdMdlCSo3a8cKZlN+dXd9A9VTIRPQOuO9aACMt3U+A1wgyGeakQQjPQJ r0w+9PKd4ewUB4c3S3aZ8if5otx4vmu0F00QwixYRjX2NetIstGFBYAKLM6WlggCHLda K1Hw== X-Gm-Message-State: AOAM532x+F6BfwjJsffbybxuS67i93UACKzwGbymgdbrecXeZOvdyUqu FTHKe53jHqyixlRJkXHcN4Tl9iSLVZnUaUFiyM+jr3cWq+A3YTHDKi/pFbqJa3yJyCGkK3IMYff drEJT69iIXhxmt52Pf1vwjLhm X-Received: by 2002:a17:906:ce2a:: with SMTP id sd10mr446118ejb.154.1636387155364; Mon, 08 Nov 2021 07:59:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJzM+ps60VfZ94gEqS5fzeul9kwGKMKVeKZIAnSvvogw3JjAS/vRJ5dtMKHz5XSx9gQP8MDeNw== X-Received: by 2002:a17:906:ce2a:: with SMTP id sd10mr446099ejb.154.1636387155187; Mon, 08 Nov 2021 07:59:15 -0800 (PST) Received: from [10.40.1.223] ([81.30.35.201]) by smtp.gmail.com with ESMTPSA id r7sm7446410edd.5.2021.11.08.07.59.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 08 Nov 2021 07:59:14 -0800 (PST) Message-ID: <5413cf06-6058-647a-0bf5-b7ae5cdd793a@redhat.com> Date: Mon, 8 Nov 2021 16:59:14 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 Subject: Re: [PATCH 09/13] power: supply: bq25890: Add bq25890_set_otg_cfg() helper Content-Language: en-US To: Andy Shevchenko 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 References: <20211030182813.116672-1-hdegoede@redhat.com> <20211030182813.116672-10-hdegoede@redhat.com> From: Hans de Goede In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 10/31/21 00:10, Andy Shevchenko wrote: > 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; bq->usb_event is not an enum, so there is no need for this. Regards, Hans