Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp1338275imp; Fri, 22 Feb 2019 01:17:26 -0800 (PST) X-Google-Smtp-Source: AHgI3IZ0AgI/CWTdN3NeVZL0as29wjHRoEakJoBC792w7Fk15hhSx2OuHMcCMbHu2EofftBIvaXZ X-Received: by 2002:a63:1f06:: with SMTP id f6mr3020593pgf.385.1550827046755; Fri, 22 Feb 2019 01:17:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550827046; cv=none; d=google.com; s=arc-20160816; b=BJjLUH+nSLhIqj3JUjXtS9rcSPPScRZIue6JFNZhWl4CxeYIfsGXKf7ZQQtG5QDz16 YSsjxaE2G5h2fcVbfdUEytpzJxySAWLqaJ+J8TWXkSOH+WImwlqCDBoObPMGxhRewhpC 3DrZ3rrYrR8f0tuQyLt53iFDEN11l6dBb8UdyFT0OaKdkqcGwgPQRFjwmNPKygPbx60a qD+zLCiOlcLbFUK7xMmn6IOGfkCGNyaA+WFSSY5CGJEPg3fl0tpMtIZa3o2k49DLhDCn ygvwDUfL4jLyxcSoF2zj0kM5l8Ljgd5y2QjnpH3bISkLE/hHy/WWChDDGWirc1K8yV7c L74A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=9s9sENDVvcQk4+5EmVMidR0j8JyqjATq/o7SGgapacY=; b=ifqd9TdGCAi3mdLDtnRuhMHBqtgMPL9KHVFq7GqpG65Mv1p/vn0uKvNaVVmfqNYkNH Dzb8pZCyqn3M0DSBRaAcjCGRy3N0mzE3lwrg6bY0l3SdduBmyMU8qdPdmFvfD58pZrSB 824x6eSIS89GwYzub0qrQm7Os17CeF/wjUWo0OyQE1pOPPvqWziA18urqKGZ3FEd9SsX xGVRAUXtSPlwsklHLK6FmdTJbzJQ9yDUP8cvfGcylXZlKoGC4drBZHs8JEfJePDBn8Ys XIm70IrJObBkNhJGuu2mVwCqUAZle4naZ89VMxGsYoYgzdbFdDvu9WxTduwHb01jJCdP WV6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=sqm5I3p0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t85si953369pfa.110.2019.02.22.01.17.11; Fri, 22 Feb 2019 01:17:26 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=sqm5I3p0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726919AbfBVJQs (ORCPT + 99 others); Fri, 22 Feb 2019 04:16:48 -0500 Received: from mail-oi1-f196.google.com ([209.85.167.196]:44283 "EHLO mail-oi1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725894AbfBVJQq (ORCPT ); Fri, 22 Feb 2019 04:16:46 -0500 Received: by mail-oi1-f196.google.com with SMTP id a81so1172681oii.11 for ; Fri, 22 Feb 2019 01:16:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=9s9sENDVvcQk4+5EmVMidR0j8JyqjATq/o7SGgapacY=; b=sqm5I3p0Upvvrs+vn7pf/xGxX/4AO2YhlQnyJ5UmoVDvjWgAOsuhC8GQtSpTqGlvte HgBTbhx6pwx1v4f1dPGHaq20qFD6XjRDIznUdrTT7BmPo96FOCDRAHvUMu37NJu/2d8X oo8iL5F0MMSu4EiEpw/aVKZ+CAnr6vml1Loa2WPn0J1jTQ/50NBzE0o3EUBEzIUT904s ExQdG3sz8jj0mM7YzChHMxJ8/HRSFCmUZULkWHsyfAeqHwCMG9uI9C3w3CyKg1KtPFqn d4skoOJ3K6yR/2CluZRMFlxZ95q9OhpmF0sCvdWEhm5r93E/qziVa5TbmPzNKsV0o8NU +p8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=9s9sENDVvcQk4+5EmVMidR0j8JyqjATq/o7SGgapacY=; b=HFj2okxJCGm2fz87TUNEH2MiTyQNzp3IrVXCe8mJcvXvx9RHSM99roeQzXFWqqfrxk PEwcOZwpwh/QCYIpP2QUPrtwu4xzp0armAFzCse9Xqzyn5oX5C6JXz2sDD+TmRDdpwXq wf/1bpVbRlP35R376ZdH/Uq+tAOIkD1abf2ptdtCOPMpC3TT/qC/SSMmxfrD3ferqNIh Jeq7+brxahTExCtaZ5vsxWRS6ObGfbp7cdc76+iPRWMtgNKwo1JwkScCFGkYRva1k5x4 EiAEWrIZvUNNYk2Vg+crEWVfWYcFrSjQNRcPACbmvBon0HHJkY49RcCit5z8DkfkK8BO 36dQ== X-Gm-Message-State: AHQUAuaFGvMiKQjUpCWTrJ+YycNCLW1wb1V0U+/jSMKYKeSh+9V7DNhp VgBv3EhWK8XEEOrhk3crRMm92e4Are/xLLmRF2J+HA== X-Received: by 2002:aca:fd91:: with SMTP id b139mr1942368oii.170.1550827005569; Fri, 22 Feb 2019 01:16:45 -0800 (PST) MIME-Version: 1.0 References: <20190222090921.2068-1-axel.lin@ingics.com> In-Reply-To: <20190222090921.2068-1-axel.lin@ingics.com> From: Bartosz Golaszewski Date: Fri, 22 Feb 2019 10:16:34 +0100 Message-ID: Subject: Re: [PATCH] regulator: max77650: Fix set_current_limit implementation To: Axel Lin Cc: Mark Brown , Liam Girdwood , LKML Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org pt., 22 lut 2019 o 10:09 Axel Lin napisa=C5=82(a): > > Current code always return error, fix it. > > Signed-off-by: Axel Lin > --- > drivers/regulator/max77650-regulator.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/drivers/regulator/max77650-regulator.c b/drivers/regulator/m= ax77650-regulator.c > index 411912d5278b..a1af414db751 100644 > --- a/drivers/regulator/max77650-regulator.c > +++ b/drivers/regulator/max77650-regulator.c > @@ -243,7 +243,7 @@ static int max77650_regulator_set_current_limit(struc= t regulator_dev *rdev, > { > struct max77650_regulator_desc *rdesc; > struct regmap *map; > - int rv, i, limit; > + int i, limit; > > rdesc =3D rdev_get_drvdata(rdev); > map =3D rdev_get_regmap(rdev); > @@ -252,11 +252,9 @@ static int max77650_regulator_set_current_limit(stru= ct regulator_dev *rdev, > limit =3D max77650_current_limit_table[i]; > > if (limit >=3D min_uA && limit <=3D max_uA) { > - rv =3D regmap_update_bits(map, rdesc->regA, > + return regmap_update_bits(map, rdesc->regA, > MAX77650_REGULATOR_CURR_LIM_MASK, > MAX77650_REGULATOR_CURR_LIM_SHIFT= (i)); > - if (rv) > - return rv; > } > } > > -- > 2.17.1 > Thanks for spotting that! Reviewed-by: Bartosz Golaszewski