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 X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4057AC433E0 for ; Wed, 29 Jul 2020 08:34:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 159EE206D4 for ; Wed, 29 Jul 2020 08:34:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726797AbgG2IeW (ORCPT ); Wed, 29 Jul 2020 04:34:22 -0400 Received: from mga11.intel.com ([192.55.52.93]:14119 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726299AbgG2IeW (ORCPT ); Wed, 29 Jul 2020 04:34:22 -0400 IronPort-SDR: /+XJbQt/T6tcFpCeWg+5/d4dHC8NcwjkdX1TUeObzaWLJN4bH+zftm8OnzUed8fCBpEyeD0oKG 2q/Y0TrQCKbw== X-IronPort-AV: E=McAfee;i="6000,8403,9696"; a="149222005" X-IronPort-AV: E=Sophos;i="5.75,409,1589266800"; d="scan'208";a="149222005" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Jul 2020 01:34:22 -0700 IronPort-SDR: cFBSlrGGkxa6jxqb+55m7agHATOc8LcEqIQlJNuSctxMrRbTYWYzc9VeSPrVATEVjPbTnrUsxK psHxcvAvnoxg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,409,1589266800"; d="scan'208";a="330331689" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by orsmga007.jf.intel.com with ESMTP; 29 Jul 2020 01:34:20 -0700 Received: from andy by smile with local (Exim 4.94) (envelope-from ) id 1k0hXX-004eYT-Lu; Wed, 29 Jul 2020 11:34:19 +0300 Date: Wed, 29 Jul 2020 11:34:19 +0300 From: Andy Shevchenko To: Maxim Kochetkov Cc: bigunclemax@gmail.com, Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] iio: adc: ti-ads1015: fix conversion when CONFIG_PM is not set Message-ID: <20200729083419.GM3703480@smile.fi.intel.com> References: <20200729075908.10463-1-fido_max@inbox.ru> <20200729082128.GJ3703480@smile.fi.intel.com> <5bfad7df-ee64-f94a-003b-06320b9fad0f@inbox.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5bfad7df-ee64-f94a-003b-06320b9fad0f@inbox.ru> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org On Wed, Jul 29, 2020 at 11:26:51AM +0300, Maxim Kochetkov wrote: > In case of CONFIG_PM is not set: > > static inline int __pm_runtime_suspend(struct device *dev, int rpmflags) > { > return -ENOSYS; > } > > and ads1015_read_raw failed at: > > ret = ads1015_set_power_state(data, false); > if (ret < 0) > goto release_direct; > I see. Please, elaborate all this in the commit message for v2. P.S. Avoid top postings! > 29.07.2020 11:21, Andy Shevchenko wrote: > > On Wed, Jul 29, 2020 at 10:59:07AM +0300, Maxim Kochetkov wrote: > > > To stop conversion ads1015_set_power_state function use unimplemented > > > function pm_runtime_put_autosuspend if CONFIG_PM is not set. > > > If CONFIG_PM is disabled, there is no need to start/stop conversion. > > > Fix it by adding return 0 function variant if CONFIG_PM is not set. > > > > I'm wondering if you check the real code (assembly) for any difference. > > > > All calls AFAICS are statically defined in !CONFIG_PM case and compiler/linker > > should be clever enough to drop this completely. Isn't it the case? > > -- With Best Regards, Andy Shevchenko