Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp2441495imw; Wed, 6 Jul 2022 06:07:06 -0700 (PDT) X-Google-Smtp-Source: AGRyM1v7jiFwntrlGz/aMsmfR/JF6ZlJf7azKbPFaqWvqHi682lczaeancSYE1WiKqBA4VmmdZRX X-Received: by 2002:a17:907:3f1d:b0:726:c927:769b with SMTP id hq29-20020a1709073f1d00b00726c927769bmr39517403ejc.754.1657112826123; Wed, 06 Jul 2022 06:07:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657112826; cv=none; d=google.com; s=arc-20160816; b=y/VcmFNR3Ds6Obt8lbZmWRVv6aS6lVYDD/VmVC/eAV0fuhZX1wUsH7y1VrMGNWO0oG dq0NTALgwTS9DqUnM5GpILLua+5gUCYMal8ezOzDk6P9QZM1uA8QU/4v5I2AswIyrht6 jx+MZJfQuEWtzurqRstYNjnZbBsqx6Kb+f3s8YNLkju7F3OrH40GAGX4OJPtDaAYrLWr jOvpce7+Eq9vojHrJwv8nYKhKQjBhue3jNcsFhmNjfiGmTQA4+kVTiHOjaPksmLpPD9b 5u6A5nhURIF7gQWo1BwG8RlbE8uoBfXzWJRxAAE50O9UIoSYOWpFyzz+/qUCAjMm6+j7 QN4Q== 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=sTOpDj3B0JNGWnvk1OWAvZnWT1OVUubXtuttRhdrPpM=; b=sQJ/DPQbbPqyvjtfYZa3G1C4xMN+nFG2Sr9oaoDhZWegTqESm/A3f0p9tmvVNvtvtl pYHs8Nyniu94WV5Yos4rPRV129XV+WK1fL1dn5jbvjG5Is/vj+MwqOgsiWKeXLJXSO+W hcoSwMLvqhpcF73wq70F4sUthAlHm1P/woQdbKgAsXR5lgDGzD61+WC86nOnlirPphPO iwvDxZRhdrZy5TnPDT79ON59CA/fq9tMGu1Rz5ih/5+c1ROoiLQxPH3QPqQ5XGHCvzII HF1RL5ykRRCzRcUo1alddn5AfjsZGwSlhTN75ppcol4CdM/9bWIzF17f6lKlwwYCTZ9r e2uQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=k1QLo+8y; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r7-20020a05640251c700b004377a1786c2si25439298edd.581.2022.07.06.06.06.40; Wed, 06 Jul 2022 06:07:06 -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=@gmail.com header.s=20210112 header.b=k1QLo+8y; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232923AbiGFMgq (ORCPT + 99 others); Wed, 6 Jul 2022 08:36:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232245AbiGFMgo (ORCPT ); Wed, 6 Jul 2022 08:36:44 -0400 Received: from mail-yw1-x1132.google.com (mail-yw1-x1132.google.com [IPv6:2607:f8b0:4864:20::1132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ADF981BE8A; Wed, 6 Jul 2022 05:36:41 -0700 (PDT) Received: by mail-yw1-x1132.google.com with SMTP id 00721157ae682-317a66d62dfso138428067b3.7; Wed, 06 Jul 2022 05:36:41 -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=sTOpDj3B0JNGWnvk1OWAvZnWT1OVUubXtuttRhdrPpM=; b=k1QLo+8ys7NyUAOL0fmOmMeACSgLMkm66WZnE4lyiyUyXvUqqiJFX432ZMIs26K6e+ KRnG/cXS4CMPiLVh6RmFsDVrGWoeFYDyANNBVRq23+pvD5kGrZTH610t4n8+XzQc7Sjo o+AlQOPYCg/pjEFLFEGXf0TyTzhgZpuR2eYdPoWLmw6Fi33PrXwvgqwDpxHqovNo+Zm/ SmiZ/tFCaBpToim9J6dgXRJhbcd56t/ZYXVIyf64B/P1fiN/otZLO10pmBN0XT6pjJmY FHk+nQX0Q/9lDPyzdmGQqxp2Zpwhu8zt2w1/Ikt2U4PPu8pFmRjyrdEFsCZX80W+lZVe yRKA== 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=sTOpDj3B0JNGWnvk1OWAvZnWT1OVUubXtuttRhdrPpM=; b=bTrLdtjjMvIBsUHp25jK6hKGNXZlPFahdX7/RfP2w2xfpCV07zwwxH2HGLodmmgWsF XHu2v7Ofo+g+QS3ExJrpcOj8PpLlR2P+mliYQMK8Dl9L2xgCNibKY8Ulg965d7LHf2W6 iSPjLmCAII9pq9EfUBwdIUvw+Nbz3sMBHpXLiUUUFH9RBlrbSldoR3ZloQ8cfaDQURJD 2eH+t6SoKdQCz4ObdheEQyaSXeGITfjYi9rgE93E86D4/Co3yzMfFDHz+nvANdoG9gaT 8Ox+M6QmuCfKM45wjY22EK8o635Jtu0k5AJNvn7cwSnLUH7Z8rhy27gxIA3oorpArVkX jEgg== X-Gm-Message-State: AJIora/cFtiHuUnkOnmykRg6w+giHiDaVuOgHtZujs9CLlomTteB/UYQ pJSCcqTKhhQjv1T6zELA0PHLu3spkcVgblRR3To= X-Received: by 2002:a81:108f:0:b0:31c:d7ae:9ff1 with SMTP id 137-20020a81108f000000b0031cd7ae9ff1mr7723915ywq.18.1657111000815; Wed, 06 Jul 2022 05:36:40 -0700 (PDT) MIME-Version: 1.0 References: <20220705121756.41660-1-kai.heng.feng@canonical.com> In-Reply-To: From: Andy Shevchenko Date: Wed, 6 Jul 2022 14:36:04 +0200 Message-ID: Subject: Re: [PATCH] iio: light: cm32181: Add PM support To: Kai-Heng Feng Cc: Kevin Tsai , Jonathan Cameron , Lars-Peter Clausen , Hans de Goede , linux-iio , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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 On Wed, Jul 6, 2022 at 4:02 AM Kai-Heng Feng wrote: > On Wed, Jul 6, 2022 at 3:12 AM Andy Shevchenko > wrote: > > On Tue, Jul 5, 2022 at 2:31 PM Kai-Heng Feng > > wrote: ... > > > +static int cm32181_resume(struct device *dev) > > > +{ > > > + struct i2c_client *client = to_i2c_client(dev); > > > + struct cm32181_chip *cm32181 = iio_priv(i2c_get_clientdata(client)); > > > > Simply device_get_drvdata(dev) ? > > iio_priv() is still needed to get the struct priv. I'm not objecting to that. My point is that you don't need to dereference dev --> client --> dev. And yes, I see that client is still used, but it's again not about my point. > > > + return i2c_smbus_write_word_data(client, CM32181_REG_ADDR_CMD, > > > + cm32181->conf_regs[CM32181_REG_ADDR_CMD]); > > > +} -- With Best Regards, Andy Shevchenko