Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp61110pxb; Mon, 8 Nov 2021 09:44:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJy01B9RjA6p78NdIQGDYhQFVJ+Eryqh5AvEBrkdY/dNJ3sbyVvO7sNzfQ4XO/1Zo/xIy5DG X-Received: by 2002:a05:6e02:1847:: with SMTP id b7mr624410ilv.102.1636393490880; Mon, 08 Nov 2021 09:44:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636393490; cv=none; d=google.com; s=arc-20160816; b=IVwnzWo1L/MI1M6nzcrJm1WxuZ+va7iAsz62Q0kXSWOY4GhLSAXReIn2I7bMQ/aOHb /v0NgNGmoEa1jWugFVtnGdBEi2BfEAd8zlOCFy6YC+SFjUXcak/VgjRtkRmhvMr5V7S9 gR5wxoMHgQYXZrI93KeyNFXwzB6x73jxw3hkcaHcvnbym5jSj9UBf+yEz6nQi1+gnCBA wKgf6xf9zpjOHjR5aLNBN+2LtHyc2W5e1fUuCBXe2C3xYr2lb5U0FoAQK7GbQPnNH41s I5r82lWCPmkNrH57h8K9049R5xiNReT1dVlLIVRjk6dcyYS6gbaUGuAliSu4ICpahVG7 XY8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=0FX33YX3/KEHbRU3d7P7kXufc5u/aEPzAlj6z3nAH7Y=; b=dS0j1MG35zVKJl6RNQ3f6HcX25ackQ2+ndyhVRz9rWgqxBmCSRtJvJ7U9lTdzqBMAM ur420YczQ46sOEkLu7kQb0R7LBX1kY0H/ooqh4MWRF2KqvTX4Q5pa1+NfWEhdSYWDZZC jE47CW7s60Zd04YrqRaeElqF93XyPUBDvL8OQYDZmwv+x+l7rx3/e5/250Ss+vkV7U+J 6wVtBeGOXnSRJRNZeSDRL9TDsC1aVLK4RZjyMUL4aYgjyGnUKXFTNqGANhP9U7zXe3N7 FBkafNQi7VUMj23QhM/wwDcs2rqZ7BYyzBWv43p/1uRhBO0VhzsQQB+VB1ZXAzkr2Fjw f/EA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="OA/OVwsv"; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y10si21963883iov.63.2021.11.08.09.44.37; Mon, 08 Nov 2021 09:44:50 -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=@redhat.com header.s=mimecast20190719 header.b="OA/OVwsv"; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241177AbhKHQCJ (ORCPT + 99 others); Mon, 8 Nov 2021 11:02:09 -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-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