Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3095278imw; Wed, 6 Jul 2022 17:38:39 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sPsvTuq61d489OFFAoqLaiaMzViy3+2GXi6LIF6o/YMzeWYZ6pbDbEOyGELXP10SWytd+6 X-Received: by 2002:a63:4558:0:b0:411:442a:b740 with SMTP id u24-20020a634558000000b00411442ab740mr35981424pgk.540.1657154318854; Wed, 06 Jul 2022 17:38:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657154318; cv=none; d=google.com; s=arc-20160816; b=FekisqQZ9lY6jIlpdpgkz0du49F+7EUZBZY+hrPNDIXr8SFsOxavfPmwQKOP3q7KmI ezpEVi4BdAgbEmBSH8A6blUVXN8ekKMTCnHXpz5dEirPUIR7zXm38yUMJ/lGvsJz7LI7 bB2S8O0EVOk6T/U/UayXwg/sjbOXl8DWpqP3vx2t2cROizqyBD8vkD1R9kPjMi8pQ5gv spUsqj8JUqgXzRDqEsTjtSyvBM13tMwkHwqilYHubc4ntBoiNfytVHutEhbL5Ps3f/P7 Ros3OgzqSt7/GnG3qc6DXdCVgOHpZJCeueFyLbaTgamW3FmVWuvdlB8MhU2bpo7Kd6+f XT1g== 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=YQXgPRoGuymP1adtfMF9k6DYRLeji+HUOZ31gzrwGtk=; b=Waf4vCeuMRiES4MkbWKuqKcGcrTV0v8fNrPhDx2ZvjfEiROjdqurI8zRWsF19a0Bd5 Rn5i9p1C647o2pqpuPsDshhQ/Kw4oSKRUl92badkM6FtwDT3hc4p0QvLIhIM5y2OQQwi m2+OaIXT5TRTdmQqkMQoj3MaoBEqyt+VWMOFMRagJ/2HN5/H46/9ai26gBMQ+rgvapk5 3LMedi5Min5bimTVE/ESN5jyMrwyQHOMPMvz/338WdCBu8Cn4tKmtVeMVR/R5iwGIeq7 NhtKESLABTpiWI9NJQ+EbNA+yFDlnr4xNBbjOiAgK+3fZfFTfFR1fSL2f3tm1ZVoty+r T2Uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=ph3jAau4; 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=canonical.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h69-20020a636c48000000b004124349a265si14757783pgc.122.2022.07.06.17.38.24; Wed, 06 Jul 2022 17:38:38 -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=@canonical.com header.s=20210705 header.b=ph3jAau4; 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=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234161AbiGFXyd (ORCPT + 99 others); Wed, 6 Jul 2022 19:54:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233576AbiGFXyc (ORCPT ); Wed, 6 Jul 2022 19:54:32 -0400 Received: from smtp-relay-internal-0.canonical.com (smtp-relay-internal-0.canonical.com [185.125.188.122]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B56172D1D4 for ; Wed, 6 Jul 2022 16:54:30 -0700 (PDT) Received: from mail-ot1-f72.google.com (mail-ot1-f72.google.com [209.85.210.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id A82E73F6F9 for ; Wed, 6 Jul 2022 23:54:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1657151668; bh=YQXgPRoGuymP1adtfMF9k6DYRLeji+HUOZ31gzrwGtk=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=ph3jAau4xITx2WTN6shMapd5RWopmq/EWLHy9D0ygTmpMgnSUUNUULrBDtrfOw73I L0OL4vJhfsJqkgkXqqtx0SYvf4MsZMEvCyxJrWTb3gbjLwwm3EFrMlZedOIrrANItu RJO8UGK7qpE6Gb/rpOsrla9h7dNWS2W86ReJKzWY8ibFG04ivcxyYkxaqStM0BDnm8 rx5aeRnVemrBzXv5WPdfycdwfZlgsfzwfYK29KDgsbC7JuhGDfzmqzHIKSR1siZZi/ UbU0xnOO8bjGReReS0izuWY7sw46sLCzB430YbUVH86LFhr4yjLIdvfouI5q+XBiTO 8EVPF3lTWc/uw== Received: by mail-ot1-f72.google.com with SMTP id e1-20020a9d63c1000000b00616b6cb2885so6765602otl.23 for ; Wed, 06 Jul 2022 16:54:28 -0700 (PDT) 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=YQXgPRoGuymP1adtfMF9k6DYRLeji+HUOZ31gzrwGtk=; b=GWGOGE3j3OOPKRV82TrYSlEIxtgulvFHdH5VeYRpMxevpp3NtVsZjXbGrb4Myb8Vg9 5y4QWiPa6ZNUEnJZYiLZToxjTH77BW6l4AXvVLnPx1HfzcoE1+kwdPAWcbyHqUq+DO14 DzNhI5hzl5y1yib5hs+V7M1Lkx0yUh0mBqOxvisHSxAq0gNXEzCAKCkeNXXcz2Q2ZJ11 QDSXqILJXFGcG7q75qMqNWiUvAfdaMSxVaTvFUMEE3EKRxgOOwrQp1Zvpuk1k0b0kcEN ZLFvQDQwT758ArqH8PkX1/2NUL+sFgIn57vu6qtciUBgjSkzW9GnITJqqqVeO6x4uXY5 QUgQ== X-Gm-Message-State: AJIora9x90IKFF1kSJDpfwnASy4eQ1chkaakkCoOv9juOdjawcdmvcOE xqbrtlOrxIfkVmeBl7Zczab+Wke4So6/nXvTSmxhoZgMcnIgNElmix+T7s2cdhHu+qAL65tNjzY 8VbRFOcV7a/r6uT09GfuQpQX5L6scv4uCrEbx5btPDfyF8wOqHgCpvIHzjg== X-Received: by 2002:a05:6870:51ce:b0:101:c7e3:d7a5 with SMTP id b14-20020a05687051ce00b00101c7e3d7a5mr853732oaj.176.1657151667396; Wed, 06 Jul 2022 16:54:27 -0700 (PDT) X-Received: by 2002:a05:6870:51ce:b0:101:c7e3:d7a5 with SMTP id b14-20020a05687051ce00b00101c7e3d7a5mr853721oaj.176.1657151667152; Wed, 06 Jul 2022 16:54:27 -0700 (PDT) MIME-Version: 1.0 References: <20220705121756.41660-1-kai.heng.feng@canonical.com> In-Reply-To: From: Kai-Heng Feng Date: Thu, 7 Jul 2022 07:54:15 +0800 Message-ID: Subject: Re: [PATCH] iio: light: cm32181: Add PM support To: Andy Shevchenko 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=-5.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 8:36 PM Andy Shevchenko wrote: > > 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. You are right, let me send v2. Kai-Heng > > > > > + return i2c_smbus_write_word_data(client, CM32181_REG_ADDR_CMD, > > > > + cm32181->conf_regs[CM32181_REG_ADDR_CMD]); > > > > +} > > -- > With Best Regards, > Andy Shevchenko