From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D5D32C38145 for ; Thu, 8 Sep 2022 12:43:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232001AbiIHMns (ORCPT ); Thu, 8 Sep 2022 08:43:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231976AbiIHMn0 (ORCPT ); Thu, 8 Sep 2022 08:43:26 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B8F04E6237; Thu, 8 Sep 2022 05:43:23 -0700 (PDT) Received: from fraeml709-chm.china.huawei.com (unknown [172.18.147.200]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4MNdwd4tlGz6857p; Thu, 8 Sep 2022 20:39:13 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (7.191.163.240) by fraeml709-chm.china.huawei.com (10.206.15.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 8 Sep 2022 14:43:20 +0200 Received: from localhost (10.202.226.42) by lhrpeml500005.china.huawei.com (7.191.163.240) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 8 Sep 2022 13:43:20 +0100 Date: Thu, 8 Sep 2022 13:43:19 +0100 From: Jonathan Cameron To: Andy Shevchenko CC: Crt Mori , Jonathan Cameron , linux-iio , Linux Kernel Mailing List Subject: Re: [PATCH v3 1/3] iio: temperature: mlx90632 Add runtime powermanagement modes Message-ID: <20220908134319.00005f59@huawei.com> In-Reply-To: References: <32c4b72624e4a3480b202f24f506ca91029e47f7.1662454215.git.cmo@melexis.com> X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.29; i686-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.202.226.42] X-ClientProxiedBy: lhrpeml100005.china.huawei.com (7.191.160.25) To lhrpeml500005.china.huawei.com (7.191.163.240) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 6 Sep 2022 16:16:07 +0300 Andy Shevchenko wrote: > On Tue, Sep 6, 2022 at 4:04 PM Crt Mori wrote: > > On Tue, 6 Sept 2022 at 14:37, Andy Shevchenko wrote: > > > On Tue, Sep 6, 2022 at 1:52 PM Crt Mori wrote: > > > > On Tue, 6 Sept 2022 at 12:21, Andy Shevchenko wrote: > > > > > > > > > > Very good and documented code, thanks! > > > > > I believe you better to use DEFINE_.*_PM_OPS instead of legacy ones > > > > > (due to pm_ptr() usage). > > > > > Otherwise, with some nitpicks that wouldn't prevent a green light, > > > > > Reviewed-by: Andy Shevchenko > > > > > > > > > I checked DEFINE_.*_PM_OPS usage around drivers and you either have > > > > SIMPLE (where you define suspend/resume) or you have RUNTIME (for > > > > runtime suspend/resume), but never are those two together. So I am a > > > > bit puzzled how to get this working. > > > > > > The one which suits here is called _DEFINE_DEV_PM_OPS(). But it's > > > basically the same what you put here with the possible unused case. > > > > > I thought underscore prefixed macros are the ones not to be used > > directly by drivers. I also found no occurrence in current drivers, so > > it was not something that was done so far? > > Looks like... Okay, then let's leave it to the maintainer to decide. > Indeed. Discussion ended up at right place. Don't use _DEFINE_DEV_PM_OPS() in a driver. The solution here is correct as is. As a side note, I think _DEFINE_DEV_PM_OPS() is getting removed or redefined as part of tidying up the missing EXPORT_* cases. (I'm too lazy to find the patch set but it was for mfd drivers). Jonathan