Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2907516iog; Mon, 27 Jun 2022 05:32:15 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vlPhuDX2kRqzPPxDqhtC664Yv9AtakUKRpv8HnA+8PVSxwbp8BnhvpeJ/bh0keKxifiq3W X-Received: by 2002:a17:90a:df98:b0:1ec:96e5:b04d with SMTP id p24-20020a17090adf9800b001ec96e5b04dmr15621767pjv.185.1656333135159; Mon, 27 Jun 2022 05:32:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656333135; cv=none; d=google.com; s=arc-20160816; b=Z6kXKjs7wUooZA3nyUMgfxpD7vKdIPE+8JgQV6M4413EQh8mRBDkYPVU0NHkLvWc+k sHgEqGV57RgwKIadCg3gSKg89lMTuXbXKOdwSEpdX220gVUUfYF+RvX8LzFVpEcApmBV SfmGIN8D0Bb+RHSkuSKojYLRVQxNtr1Zw4jjvPqWvvzIh8AhOK8/lYeMaP1m2nzsYjhJ zGh64Fb6PAl1LZmULRX3DL20+tubMAF71wMD2d6ER2byy9PfBzlgYb/RQcbi0Un1xi+U HCrk/o4oeftTThTM3wcc5U7an/8QterBQQVkE6Yurc0ah1IRKeb/TeQeA6+ZPxttybDF 4fCA== 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=x+gZ2sMX4AXpdnOJ8ntRrL931nXfMeN/nMld6i99OELo83vkJE/Mv3U1NqOh7cUrmF 2ViUqH+5y3BphjALxd2PDe6ZbrlLvRfLUBfw4YxBjlkfI5iFn5G0z6hNm6/7T4Qtcsd4 4kkSe+BW1FJUrxenfmYGpxAqONlLH/7lqpSmHpa4wLES20BXbTEWC5sJc91G3MfUGoX+ 0IahJxMPpzjkGcWVPrwNNIh2m4d6TXCqjiEdKm+RPqTv+K/Csv2nky3lYxlKZrQU90kF 99tdx3OlWPNnxgKIWVZmkjXCvkzGGCw4a8BM0YFj/v6p/IYvmodR/IxChOoeNgodejeV kV6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=dh5SAodd; 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 k69-20020a638448000000b0040dd2904e95si6705238pgd.51.2022.06.27.05.32.02; Mon, 27 Jun 2022 05:32:15 -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=dh5SAodd; 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 S235829AbiF0LeX (ORCPT + 99 others); Mon, 27 Jun 2022 07:34:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51176 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235936AbiF0Lc5 (ORCPT ); Mon, 27 Jun 2022 07:32:57 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F371B2; Mon, 27 Jun 2022 04:29:55 -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 1E9D26149A; Mon, 27 Jun 2022 11:29:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 27AC4C36AE5; Mon, 27 Jun 2022 11:29:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329394; bh=CLKucOR1KV+hTdnmQuZOHWx60dJ5jfawBtDEBI3Okjc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dh5SAoddwZnR0O8AKreneThaKyYjCwuhpCKz3/hV5NApZmXDbtsgWBDu7Sllzz8fW s4Aj00VP5RJgFZK6mytIvV9R9b6mgN+OYfeAj7zwq98B375YJM65Crou0YKWJGCWYp oyjCWlaNvu+IoHAqQwN9UHE+zY5TYLfPWkKXcXjo= 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.4 42/60] iio: gyro: mpu3050: Fix the error handling in mpu3050_power_up() Date: Mon, 27 Jun 2022 13:21:53 +0200 Message-Id: <20220627111928.927348219@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111927.641837068@linuxfoundation.org> References: <20220627111927.641837068@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; }