Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2251738pxp; Mon, 21 Mar 2022 15:01:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzPtxnq97m/fG2c15HyjNjmnIwhbGe4ryAjIZ6E0t7oYg68KJ3Hqz66pQ3dU+/YtRX9/bsM X-Received: by 2002:a65:674b:0:b0:381:6565:26fc with SMTP id c11-20020a65674b000000b00381656526fcmr19322905pgu.618.1647900114405; Mon, 21 Mar 2022 15:01:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647900114; cv=none; d=google.com; s=arc-20160816; b=GBkrd4l57+GQwQIhcZTCAPMCfJetq+l1Sj2P4dLSGYoiyYAGc5AqsHJomarITbPsvj uVugMOHPu2os09J7CrM4mQk9t+YfHMyzC0VPDN+WZPGxPzvHo7/iSS6KJEHlwF7ASNLO Y9rR7vamM3FnmqcPBg44pBNTJwJX64fD5+hgQLCY9uBAvSw1GUXDDTaRUEs4kPBfE4Q6 ct8WfCIbKIqfOyaD6FzoznLF74y2zdzM81J2NkU41UgKSHMdnrx0CV80Adw1q69kyR6J /Qb1me09Ruzu82+Gua+iF3IRuHZzjASakc2nm3QXMYjXDuiINB/odFNuWMjM//Z2maIe QC3w== 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=ptBJ8d2HXhA8CdAaHQDtBS8m0+CIB+DKz+bbzuAsNIE=; b=aak2l3/vMv/nlVNbm1zUO1KOj816rbEFJVeW5b6niGAHxvJJDRbK7b4hKH4maLZKbd ZrH8AJ3udZV8+0jkp/nT/MVeuoC1uNfr/Mfb99Ir2JCSSj7DqrB2UWtGZdtmiCHfO+k0 n/t+oloaqrICYYtNQi1Q9QREUDc1eJ0btpalKHegNN3T1Y8M6ZN5+lfCjFlD8cED49Ir ZE5I2fR/AdairQM+jKJ8SH1Vbf86LfxDDD0HaARzK1b83bE9Mn0u+qbQJjHDOpSkBzne U1AQvHyIkh5bCrBK2gxzggjfIMO0gGwhGm29C9exk2IvBNRfSxqwrG/GRap2OB6ZkMB+ NdPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=YJNrChZU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id w7-20020a631607000000b003816043ee30si13860072pgl.37.2022.03.21.15.01.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Mar 2022 15:01:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=YJNrChZU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 78A4434B510; Mon, 21 Mar 2022 14:26:05 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345268AbiCUIdF (ORCPT + 99 others); Mon, 21 Mar 2022 04:33:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240827AbiCUIdC (ORCPT ); Mon, 21 Mar 2022 04:33:02 -0400 Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 557545D1AA; Mon, 21 Mar 2022 01:31:38 -0700 (PDT) Received: by mail-ed1-x52d.google.com with SMTP id k10so3164650edj.2; Mon, 21 Mar 2022 01:31:38 -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=ptBJ8d2HXhA8CdAaHQDtBS8m0+CIB+DKz+bbzuAsNIE=; b=YJNrChZUz2zpNGb6N7/5G9E77OX8wf8fkLLmgy4NWBBcO6XnmZ+VC1b3vI6IQ5t5EZ eIx2XtXCvqOGkg/eUU0Wi3lSh8005CWSO3WyB+BOK6HMK5JZK0opXM8dGx0XRGn94IAn kq2N9RJY/r9yUwuWmgo1HKY86cjlKzUPHGFqi3sGvY382L2yjwoG2I54Tmr1SV3YsKUx lGAr2xUcjuIldU1AHyvpNpdBVbiFvaQG7cOsg1nUo+dfkL1biCmK8dWVhV2qonk8o7Jm fbqt8c+nBhZB0mFFU+NPWvrG8w4iSj1cfOKjgkIrqurRURIf1JdbeYkgHz3RfJecj0WI /EzA== 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=ptBJ8d2HXhA8CdAaHQDtBS8m0+CIB+DKz+bbzuAsNIE=; b=lNkBnobpdA6U9STi81ieD1FzATz1HTDLirYtlFiGOEqc+YmKpFbLS07POl2pqkruNi yNcqaMK80VKoWdQg1jVZkKvE1ERwZTW4Vls1SL86JplPzGYJ9t+WdfDshVgAzXe7pDDD FvY/mWP6TSkm3do3TeR7XUuv5JJFLkdkLGs0rOTpQgrq6ceLQ8D4SHkUU+p/ui/iaB5h 7MpXq+F1mzESmM9ZplCKRdBL7y3/QAMwUe+OYqfsdkWHfKDj9Rzb3OcQKyarjij74SRf 7e2bkxtyAtbR+J1xsFH/hwZeSrFVOGIY/oivbv4uyThqvKBHbaURAyNcj1PXXtFTgLlr t6nQ== X-Gm-Message-State: AOAM532+1JUpDo0mJ15n3yQAkRYWqTNM2IATbjeRDQv+yb3QGwSO1ASp 4YKkpFN83q4eAhBC+hPUrgJJifk+GnPylt+rQ54= X-Received: by 2002:aa7:dc4e:0:b0:419:407b:6bff with SMTP id g14-20020aa7dc4e000000b00419407b6bffmr3380196edu.158.1647851496821; Mon, 21 Mar 2022 01:31:36 -0700 (PDT) MIME-Version: 1.0 References: <20220319181023.8090-1-jagathjog1996@gmail.com> <20220319181023.8090-2-jagathjog1996@gmail.com> In-Reply-To: <20220319181023.8090-2-jagathjog1996@gmail.com> From: Andy Shevchenko Date: Mon, 21 Mar 2022 10:30:26 +0200 Message-ID: Subject: Re: [PATCH v1 1/5] iio: accel: bma400: conversion to device-managed function 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,T_SCC_BODY_TEXT_LINE 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 Sat, Mar 19, 2022 at 8:10 PM Jagath Jog J wrote: > > This is a conversion to device-managed by using devm_iio_device_register > inside probe function, now disabling the regulator and putting bma400 to > power down via a devm_add_action_or_reset() hook. > > The dev_set_drvdata() call, bma400_remove() function and hooks in the I2C > and SPI driver struct is removed as devm_iio_device_register function is > used to automatically unregister on driver detach. ... > +static void bma400_disable(void *data_ptr) > +{ > + struct bma400_data *data = data_ptr; > + int ret; > + ret = bma400_set_power_mode(data, POWER_MODE_SLEEP); > + if (ret) > + dev_warn(data->dev, "Failed to put device into sleep mode (%pe)\n", > + ERR_PTR(ret)); By what reason did you remove mutex around this call? > + regulator_bulk_disable(ARRAY_SIZE(data->regulators), data->regulators); > +} -- With Best Regards, Andy Shevchenko