Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp4532731ioa; Wed, 27 Apr 2022 06:01:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzsAal0EKdQshQdi7r+GUv1nEiubfOxY3+LF3HkNxipMWEERD62Enek2/2jCR0XQiLRbl4Q X-Received: by 2002:a05:6870:2411:b0:da:3842:4a9b with SMTP id n17-20020a056870241100b000da38424a9bmr10669660oap.277.1651064467787; Wed, 27 Apr 2022 06:01:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651064467; cv=none; d=google.com; s=arc-20160816; b=AO47bNmYgrxicYBQcbsWfprCzKLnlliC0xaxUjZ+uXTGwsiKSxuLbMDgCBhtZoVgOC yGT4zVhuMtDHTlR2TdyYQ8XKCMoVhU2nu1xzdOkUikCf9CPD9LTgX5MzC4k/qzrVJTWK Tm4NWqQleKMwDjCaYIwQsLaJLLbqYQtvWbBLNHWiKgnAwzlxwzkhJtFdCncS4mL6pRhk I+c9MK+vaK1MNhSRMbkPYoAnYvJt8sPEsi3yZ3xazzaiUE2IjMjxZ/3hfinM/OjGfIip XdReI36Rrd3iOW4kx+IaF9ldHSVHkQdaMVDOr82aXR/xq9gXQe2lbMEqtoPTaoKiRE7Y 41Rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=jhfpcQvRyLbcrTp/kXyOp93AQzKLRCL6FGXAmgALmAs=; b=xETRW+2HgXR7HAVCCOdi2GcPFZkFki4RZffCfN7jA/Ho3uAgcoOdKHZWsgXw1/371w qyszQQWRscx9Ybq2yPRWrhuRKKTHkHx798oTL92xvQVptSFcs+AXaXFKPGpIWagZNejG wq+feGyKyOg+py2H3HwZutEAz1WGorKmNuJsRLjvcyxuXnxj+IXoENzAsRWp/rijc1mH xIZ1UeqBv33X33tiVHOdXcoBypyz3IDNIG/UPRZnPO3GLNVSFzyZYyRZfbMvG0efTG99 CzSkHjm3+nV0bSS1X3mAZbLE6XsqA3gEIUDhgmqa8+UZo75/mMOL5mzpHIX5Q1ngXzBH YzRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Bk1FQAG7; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id w14-20020a056870338e00b000e946bda98bsi781404oae.215.2022.04.27.06.01.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 06:01:07 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Bk1FQAG7; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 461CB53722; Wed, 27 Apr 2022 05:35:17 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234295AbiD0MiN (ORCPT + 99 others); Wed, 27 Apr 2022 08:38:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234177AbiD0MiK (ORCPT ); Wed, 27 Apr 2022 08:38:10 -0400 Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0599F50E33; Wed, 27 Apr 2022 05:34:59 -0700 (PDT) Received: by mail-ej1-x62e.google.com with SMTP id l7so3141219ejn.2; Wed, 27 Apr 2022 05:34:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=jhfpcQvRyLbcrTp/kXyOp93AQzKLRCL6FGXAmgALmAs=; b=Bk1FQAG7UVM2UrT6fvL2VChLSxmZ6j26DKtnO7pxhz+GXrsgtmkZ0TRWtaisUD5/GU oG4STG9oIQl0HCwtPEWpbCYTuzflRZ916j4Izx+MRLRyFxDaokBrmZP5Nod/J2U+VbI8 05cuNrLrV3G1nqFvKWakcvUvWOypCUL+G07bG+elFB5ZJ80xguEVpdGvRv4OHfHNoVQ+ UeBKjeGKdqU5jBp2SZvm+9bs8+9CNyoG41fLoLRK/P2kOJ72QbZNNmaDGtwylyHxZcNb S3RX/z3/eEQ6sVQ0Z/Tcdj4J569dH28eLlyf7oFvyFDdhnc2zDXFX6nrFeBjjth6ptlI EX4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=jhfpcQvRyLbcrTp/kXyOp93AQzKLRCL6FGXAmgALmAs=; b=2/pUyjfIJKaEezFfCpvJxNgAd6GqTyQsxp8ZcOY20xtcYyYbLICEGnIgWzyXGJM5YD L53xyXQqZhLddrdixRuGhjOUgIGZMOOY6oFpHMolYNSuHX4rIojO84Oz+Ccm9Vm74isd IUL1RJjU2VSuJjv655kj2Ns0gV7jNvkpKt4fzbuTXCKGSYo4fvR9IWYV+fp02BlwGpSS yT3Oxw5/0nBWBeybixs1VUGF4qBUVM1MqvkB/CqwOb5mjn4IjWL0hYgbb9W30b88yTrs tavwTFjv3Gzl3V85LEdgfgNDY7zY1zMiv2XdrBiSp/Pbo3+GOlZI9kasU2in5hyMhCiF 5mcw== X-Gm-Message-State: AOAM533ekpO8GNUC/GSLM3tWfIFzj+iHF1ZKEqFKmGeI2gFXkIJPTDOk +s0sdUHBvh+FMlzZ6NfgoAkUoUJMHAtF/100kpc= X-Received: by 2002:a17:906:1cd1:b0:6ec:c59:6a1d with SMTP id i17-20020a1709061cd100b006ec0c596a1dmr26824486ejh.77.1651062897611; Wed, 27 Apr 2022 05:34:57 -0700 (PDT) MIME-Version: 1.0 References: <20220420211105.14654-1-jagathjog1996@gmail.com> <20220420211105.14654-6-jagathjog1996@gmail.com> In-Reply-To: <20220420211105.14654-6-jagathjog1996@gmail.com> From: Andy Shevchenko Date: Wed, 27 Apr 2022 14:34:21 +0200 Message-ID: Subject: Re: [PATCH v4 5/9] iio: accel: bma400: Add separate channel for step counter To: Jagath Jog J Cc: Dan Robertson , Jonathan Cameron , linux-iio , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE autolearn=no 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 On Wed, Apr 20, 2022 at 11:11 PM Jagath Jog J wrote: > > Added channel for step counter which can be enable or disable > through the sysfs interface. ... > +static int bma400_enable_steps(struct bma400_data *data, int val) > +{ > + int ret; > + > + if (data->steps_enabled == val) > + return 0; > + > + ret = regmap_update_bits(data->regmap, BMA400_INT_CONFIG1_REG, > + BMA400_STEP_INT_MSK, > + FIELD_PREP(BMA400_STEP_INT_MSK, !!val)); > + data->steps_enabled = val; This will update the value even if we got an error and actual device state is unknown here. Does this make sense? > + return ret; > +} ... I perhaps missed why kmalloc() is needed now. Any pointers to the discussion? -- With Best Regards, Andy Shevchenko