Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2911285iog; Mon, 27 Jun 2022 05:36:09 -0700 (PDT) X-Google-Smtp-Source: AGRyM1u6/6rYQwGh+abVbc1aUVPsrjaooq+NGZbcQQP2vf/B3K0imV6qnM39qIgmmUWf3asc6FwJ X-Received: by 2002:a17:90a:1c09:b0:1ea:91d4:5a7f with SMTP id s9-20020a17090a1c0900b001ea91d45a7fmr21129238pjs.232.1656333369176; Mon, 27 Jun 2022 05:36:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656333369; cv=none; d=google.com; s=arc-20160816; b=Hfk+KLZBzZUMn60o74jbd5ZvMrCU1DZ43b18tjoY6XHQZTfmKsiir6ndZtWWxRywSr n6i6qBGW9mQ65Dn21af2ee18fS3ZV1Uap8tJ3rK/irTt37AUSpOmxSLugi3DZZsd1u8M qFMUUTu4Vp6n42QycwCnc5M95UeRf14SxW6rKkL/iGzMF2CsDhAWABb4Pbi+87+9fBY1 BGXVl3LiqkcOhkS+J1l+5/LpSj7wHs9mzUOo2HrQpIP+gzuUg5MZCkcFssH5pK4fokhw +5Prpq0LDqxO15ZVcU2DgI95JkZVk/n7cp1g/it3IitW72K7bmguTajRDiAqgsBAigeb zkmw== 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=OBr/ouTC1RUv0v1w6hUvSxAsc8TDbVEHC6YHE8+WU1g=; b=RN/78lEI869Hlte7LJjRIs/hdYL8ffUq/sIwfOwu1lgkYXGSWkQ5FxaJxrwSZlN5cH Jb4V85G9QcAOzu0DsTWpFymcKWRv/CghOqxTNlc5HvzafofRNuXohk9yELM1wAEdojhb Vd/tk3/3L7lb4Ze00nAMY9KenaIYg8kjBP9a2cfif5ZXtP8wryGxNTEdLAVrb9QQxfym N9mAWG/YzcffLbO/JOFeR4ZALNGRzpJL8FH/81QnVY3JGdYirTPYkebGj+2lOWO0P43Z N5fxiA0Rg6MkpnfPmzz0wL719PtYDKUyU0p2QUekETLFL+ooFXG5W9EwKc8BB64/1JyD wEgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="NuiS/QlI"; 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 y18-20020a656c12000000b0040ce4de349csi15487356pgu.291.2022.06.27.05.35.54; Mon, 27 Jun 2022 05:36:09 -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="NuiS/QlI"; 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 S236115AbiF0Lfd (ORCPT + 99 others); Mon, 27 Jun 2022 07:35:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235913AbiF0Lcz (ORCPT ); Mon, 27 Jun 2022 07:32:55 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65D68109; Mon, 27 Jun 2022 04:29:51 -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 ams.source.kernel.org (Postfix) with ESMTPS id E1AA2B8111B; Mon, 27 Jun 2022 11:29:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3C014C3411D; Mon, 27 Jun 2022 11:29:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329388; bh=xYxiTnQiNYNkHpstZ5wyUZKasR0aKcFMUnvba22Y3So=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NuiS/QlI5YJJokHKY1PGi79Y6zEA37KVJ4n6TUzQ7LOh+80OmgwULkfGfrpqnfbif HqMx89+e+258q9fR+ZgAIGG9ebja8YijbCkE47LkHjISNHrwJgerQokl43LlPQ13yb D4by3J5SDQ4yHoNajps0bnDbOorUCbDDpi0Miobg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Haibo Chen , Hans de Goede , Stable@vger.kernel.org, Jonathan Cameron Subject: [PATCH 5.4 41/60] iio: accel: mma8452: ignore the return value of reset operation Date: Mon, 27 Jun 2022 13:21:52 +0200 Message-Id: <20220627111928.898410833@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: Haibo Chen commit bf745142cc0a3e1723f9207fb0c073c88464b7b4 upstream. On fxls8471, after set the reset bit, the device will reset immediately, will not give ACK. So ignore the return value of this reset operation, let the following code logic to check whether the reset operation works. Signed-off-by: Haibo Chen Fixes: ecabae713196 ("iio: mma8452: Initialise before activating") Reviewed-by: Hans de Goede Link: https://lore.kernel.org/r/1655292718-14287-1-git-send-email-haibo.chen@nxp.com Cc: Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- drivers/iio/accel/mma8452.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) --- a/drivers/iio/accel/mma8452.c +++ b/drivers/iio/accel/mma8452.c @@ -1489,10 +1489,14 @@ static int mma8452_reset(struct i2c_clie int i; int ret; - ret = i2c_smbus_write_byte_data(client, MMA8452_CTRL_REG2, + /* + * Find on fxls8471, after config reset bit, it reset immediately, + * and will not give ACK, so here do not check the return value. + * The following code will read the reset register, and check whether + * this reset works. + */ + i2c_smbus_write_byte_data(client, MMA8452_CTRL_REG2, MMA8452_CTRL_REG2_RST); - if (ret < 0) - return ret; for (i = 0; i < 10; i++) { usleep_range(100, 200);