Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3350563pxk; Mon, 21 Sep 2020 11:17:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJylaPRVo3VqoZ/zQSXBa/fE+YG1HoJGYI7y4+gS4CyKDb7U2hvFoV+MWiXg2uxBXBlqn9SK X-Received: by 2002:a17:906:cf85:: with SMTP id um5mr705736ejb.479.1600712260654; Mon, 21 Sep 2020 11:17:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600712260; cv=none; d=google.com; s=arc-20160816; b=0Joz2DtTnUByz6sQGWQEoCUo6Lf7lRlgQOU8Imw6VyTREOigPomU6f0Rsr4Y/gz0XS fCqCCBHL3/mDV8iPNyK2n8pVPyHtXCeBex2VkIoWDLT87l3KzLEkTP2j/jEI+Try0mNr +ao4rs5y5AFpsTZbY/hnXDL3knjpFOyqYJLEMsOzzIFtO+lWgu6E6/bP/VRw2shhkEPo ftRLyWoAQFWK4tT6DWSo/gK8E0NhU0gxN91Z9/emWMjv8X4QjUkS02ZxWFNt8VZTAkh0 24gF6yOeJ61vNgMi6brw9ldsdbvOJgYGsT6lCmfVBPqqmL/TaY3WLzZALEo/ut5l9lek aZaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=7v72XVQY058Whlfq75xCUtS1rphFRsxgj7RRSZlNQX0=; b=CxtKWVa0eENu7yz8+JFMINcAdqaJfzg3+b/osPClQ981Ynzw+3jcFiBgoXYpkMjCbY JczGpzqI4b9piOJuW+tpI8P33ZnDDIhevJBXT31jthoslsjLdtyPIioBAotuKE1dWMHX CjrrwWbcuE1lLrrYqp0WI7PWxK0DgGr0HWMsv7KbbDQg88bMsZkKAf7IgOTGQGF1mPTG l+ll6vCLLsAYU5q5ULAm9XYNU8YrWIey0/0we+cJZ7ltFl6bJxQQOa4FgaD+Sthl/dMK E2ksfE3ewTDXaWHxQekB3jo5lzwYeAjuo+F5faejLNHcwRQFf3OPof226lWkcZDSySnW lxKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ENYhqvif; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n21si8520157edt.580.2020.09.21.11.17.16; Mon, 21 Sep 2020 11:17:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ENYhqvif; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729236AbgIUQjT (ORCPT + 99 others); Mon, 21 Sep 2020 12:39:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:40070 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728626AbgIUQir (ORCPT ); Mon, 21 Sep 2020 12:38:47 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 090AF238EE; Mon, 21 Sep 2020 16:38:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600706326; bh=68ifFe8bMTvCqox7vYKsjUGQ2ojIVQTihFkdsvI06uY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ENYhqvifKUwsAeo2cJzW81lv8IyZjZ7eA2Ydu59S78uPYI+awmo3hxtMDdK+ynBDN vuZwRcmY+YwDlqpH455ohZv+k3ZNnLGcaypx2Uldjl8ZK+J3/DWeZAAOWwFpR/jxI8 KgaHcoeZ0bwef3obzoIGkSVqpaYsUIgCq7VzqPRM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Maxim Kochetkov , Maxim Kiselev , Andy Shevchenko , Stable@vger.kernel.org, Jonathan Cameron Subject: [PATCH 4.14 25/94] iio: adc: ti-ads1015: fix conversion when CONFIG_PM is not set Date: Mon, 21 Sep 2020 18:27:12 +0200 Message-Id: <20200921162036.705978514@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162035.541285330@linuxfoundation.org> References: <20200921162035.541285330@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Maxim Kochetkov commit e71e6dbe96ac80ac2aebe71a6a942e7bd60e7596 upstream. To stop conversion ads1015_set_power_state() function call unimplemented function __pm_runtime_suspend() from pm_runtime_put_autosuspend() if CONFIG_PM is not set. In case of CONFIG_PM is not set: __pm_runtime_suspend() returns -ENOSYS, so ads1015_read_raw() failed because ads1015_set_power_state() returns an error. 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. Signed-off-by: Maxim Kochetkov Fixes: ecc24e72f437 ("iio: adc: Add TI ADS1015 ADC driver support") Tested-by: Maxim Kiselev Reviewed-by: Andy Shevchenko Cc: Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- drivers/iio/adc/ti-ads1015.c | 10 ++++++++++ 1 file changed, 10 insertions(+) --- a/drivers/iio/adc/ti-ads1015.c +++ b/drivers/iio/adc/ti-ads1015.c @@ -312,6 +312,7 @@ static const struct iio_chan_spec ads111 IIO_CHAN_SOFT_TIMESTAMP(ADS1015_TIMESTAMP), }; +#ifdef CONFIG_PM static int ads1015_set_power_state(struct ads1015_data *data, bool on) { int ret; @@ -329,6 +330,15 @@ static int ads1015_set_power_state(struc return ret < 0 ? ret : 0; } +#else /* !CONFIG_PM */ + +static int ads1015_set_power_state(struct ads1015_data *data, bool on) +{ + return 0; +} + +#endif /* !CONFIG_PM */ + static int ads1015_get_adc_result(struct ads1015_data *data, int chan, int *val) {