Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp24990pxk; Tue, 15 Sep 2020 16:43:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz27U8fqB29PGTahty7VATIhMOD1T+13JOKJwbD+NhehJ0OzJXOqx1jVfpIbCfWL599lqwt X-Received: by 2002:a50:e44b:: with SMTP id e11mr25391298edm.73.1600213419317; Tue, 15 Sep 2020 16:43:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600213419; cv=none; d=google.com; s=arc-20160816; b=yNRkugNhrHvlLVCAmUv00CTVHHcNpOx+le2Ld6ve+9340LPZnnWaDzVk4xA77apW8F Xg1cPmL7VJMl9ul4H782toufmGCRJqpnzEzhgwhAjmXZlVDQl7koay3/5PedCy/sMde9 Z1He2xtA2xGGu7jB1BmqHzaCnKOQZKY+O+XF0hZJ32RsGofGzddgjmijhh/IgxqmVKDk iRBhkTAAMD8s3nQJXjXJbT3e9TifGLMP+RbQS1rwVlghHXa6Qzbp7Nweq2IYhQYo3fb1 Xf/T5XU9n0/VM1mdrhnT3cYClygj290Jl/70sUIAw6IKKOWsV5+7HzVZcq2Rrjq39Epy KIlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=7v72XVQY058Whlfq75xCUtS1rphFRsxgj7RRSZlNQX0=; b=wRXzMlzgJYMbYK7AfGHQkkfDPLAJKxcNT/AJsJmT7GF4maj0QWiXgsm4o30f8ML8it 4PDn4aPpFyrFzeqIFW1wBax/lHC3TmYP887eDVdwu64y5q3700zwWfddg0gmJL6Ig097 15Z9ICB6XqNr+i96wh4sZNks6982vVzb4D9rm0Ns29S3MaGGA/wxPElKccMXBX78SZkm bf937zoNs7BlWs1NKRJQgdCsFKmn6rV1wGjNc+UGzLbFfCz+ohxmc3p4+fMtFspv7Qzo 7WejMvuB1fOr0gaYFQgdEUx+KaRqVSaBR6btZZcxXRXxtlUo4gFVL2CYYz6GQXEueHfK F+Jg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=GWW9vehw; 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 c12si11431118edx.274.2020.09.15.16.43.17; Tue, 15 Sep 2020 16:43:39 -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=GWW9vehw; 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 S1727192AbgIOXmM (ORCPT + 99 others); Tue, 15 Sep 2020 19:42:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:47672 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727106AbgIOOem (ORCPT ); Tue, 15 Sep 2020 10:34:42 -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 D29A620829; Tue, 15 Sep 2020 14:16:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600179389; bh=68ifFe8bMTvCqox7vYKsjUGQ2ojIVQTihFkdsvI06uY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GWW9vehwTBtEd2jLDRrjSf7V8xxvUSNMuwcAi3KPts8OJY5/ZwnrAeJYYBhMH1aTN C7iqoa+tdOUjapnBzMV3Svjx80VOSJlCEsZsRHVq3gMBH/c3iS4lrCjJhlPtOLTAUh Yvm3JnG+nf2M3EDVUqsSSknBfVlxumEtKF8jRtR8= 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.19 41/78] iio: adc: ti-ads1015: fix conversion when CONFIG_PM is not set Date: Tue, 15 Sep 2020 16:13:06 +0200 Message-Id: <20200915140635.641067364@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200915140633.552502750@linuxfoundation.org> References: <20200915140633.552502750@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org 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) {