Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2910148iog; Mon, 27 Jun 2022 05:34:54 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uFsU9QfHnWos4Nts6/gxR6U0UjIpAFhUxElBD3kZ8IgFIIvV8AQkCEgaTkqQJedxopyANb X-Received: by 2002:a17:906:c048:b0:718:ca61:e7b9 with SMTP id bm8-20020a170906c04800b00718ca61e7b9mr12367125ejb.120.1656333294092; Mon, 27 Jun 2022 05:34:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656333294; cv=none; d=google.com; s=arc-20160816; b=iW5k3BC/uJIlNPH0BJik205vTwKStg6kuy4I5Wl3pBbq+hRfnao+2xj0M0zW9QkrXa I+VylNJpaazAuttCJVJTf/c9nw4xWmQ7y0mfJkZKslFMinfIXCanESMu8S1sitVJ44b2 Fy9cnu29+qA/gJECKockSfqY7r7JAQH3f06pa0dyFlWuXKxKEw46iB3HGgCmHdAj/2ER zEsWX86xqr+Ble0bpmM0wmbFwxSliLLf9TNKhiqVm/9LybuNbEp6tRIQmPx/Loa6QHqw dNiZKASDMNkcx2dxZyiCgXk/6C0i4HqupKn37fEm8wYrk81eQU1Ed7Bx7tCRZZiop5/B i/0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=aQFEeSTndOXL/OXOvDNLRrFD8vT4rejsncNbaqrZry4=; b=r4n1ZhLgLSNixkYyetMSOvbSaF0kichUeMoIoCTpvxNIb2U1WYGpb6LV76nON35/xM GH7say6rzGaNwm6sxd8lcSFfJuURsOw8CP2AB7AClgL8inTGFTIjiLIvW/pt78vxtCDN JGtxalgd5SBz+kQ3nsocTAsBD7wKIpwgKurbtZCBfucnq113i2FnumcG5ONDQSAsxxsd EPYIaIVbmDiF+FprqUtNUFPLgirTSVWEy+fy84o0zpgvO14ZVo+VlDAM6jrhyyhbZ9ik vJW+TUURF2UTjktZkDYKbNKTMDqCQ/g9MN86btYMbHGVho6+qr4kfIgHnt/dme2SIEpj ezTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uekNuu3b; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j15-20020a05640211cf00b00435daf08a33si14423467edw.161.2022.06.27.05.34.28; Mon, 27 Jun 2022 05:34:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uekNuu3b; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239628AbiF0MB7 (ORCPT + 99 others); Mon, 27 Jun 2022 08:01:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238880AbiF0Lwp (ORCPT ); Mon, 27 Jun 2022 07:52:45 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 556FEDEFA; Mon, 27 Jun 2022 04:46:17 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E56AD61187; Mon, 27 Jun 2022 11:46:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F071CC3411D; Mon, 27 Jun 2022 11:46:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656330376; bh=CLKucOR1KV+hTdnmQuZOHWx60dJ5jfawBtDEBI3Okjc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uekNuu3blndvybXtTuD2wa0EDWSh7WeRQa3rpeWvG78+NfDHtRYq5NMekMjMvwD7W fwiuK37fs4QJ1439ZjvpZ831D48w6sDZ6IqZSOZ2GHzxPpKT4t05LFavwhcO8ltM+M ShahPyIc7rnK3vBq8STnWP2dfTao0JTXRGlMmah8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zheyu Ma , Linus Walleij , Stable@vger.kernel.org, Jonathan Cameron Subject: [PATCH 5.18 137/181] iio: gyro: mpu3050: Fix the error handling in mpu3050_power_up() Date: Mon, 27 Jun 2022 13:21:50 +0200 Message-Id: <20220627111948.660257806@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111944.553492442@linuxfoundation.org> References: <20220627111944.553492442@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Zheyu Ma commit b2f5ad97645e1deb5ca9bcb7090084b92cae35d2 upstream. The driver should disable regulators when fails at regmap_update_bits(). Signed-off-by: Zheyu Ma Reviewed-by: Linus Walleij Cc: Link: https://lore.kernel.org/r/20220510092431.1711284-1-zheyuma97@gmail.com Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- drivers/iio/gyro/mpu3050-core.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/iio/gyro/mpu3050-core.c +++ b/drivers/iio/gyro/mpu3050-core.c @@ -874,6 +874,7 @@ static int mpu3050_power_up(struct mpu30 ret = regmap_update_bits(mpu3050->map, MPU3050_PWR_MGM, MPU3050_PWR_MGM_SLEEP, 0); if (ret) { + regulator_bulk_disable(ARRAY_SIZE(mpu3050->regs), mpu3050->regs); dev_err(mpu3050->dev, "error setting power mode\n"); return ret; }