From patchwork Wed Nov 30 01:11:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Lutomirski X-Patchwork-Id: 9453355 X-Patchwork-Delegate: rjw@sisk.pl Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7876C60757 for ; Wed, 30 Nov 2016 01:13:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6CE761FF1D for ; Wed, 30 Nov 2016 01:13:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 61AD92839B; Wed, 30 Nov 2016 01:13:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1C3A61FF1D for ; Wed, 30 Nov 2016 01:13:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756725AbcK3BMs (ORCPT ); Tue, 29 Nov 2016 20:12:48 -0500 Received: from mail.kernel.org ([198.145.29.136]:39976 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756704AbcK3BMq (ORCPT ); Tue, 29 Nov 2016 20:12:46 -0500 Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0566D2028D; Wed, 30 Nov 2016 01:12:39 +0000 (UTC) Received: from localhost (242.sub-70-214-1.myvzw.com [70.214.1.242]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8958420145; Wed, 30 Nov 2016 01:12:37 +0000 (UTC) From: Andy Lutomirski To: "Rafael J. Wysocki" Cc: linux-kernel@vger.kernel.org, Pavel Machek , linux-pm@vger.kernel.org, Andy Lutomirski Subject: [PATCH 2/3] dev_pm_qos: Fix writing 'auto' to pm_qos_latency_tolerance_us Date: Tue, 29 Nov 2016 17:11:51 -0800 Message-Id: X-Mailer: git-send-email 2.9.3 In-Reply-To: References: In-Reply-To: References: X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If it was already 'auto', then writing 'auto' again would incorrectly fail. Signed-off-by: Andy Lutomirski --- drivers/base/power/qos.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/base/power/qos.c b/drivers/base/power/qos.c index 7f3646e459cb..6a1f2c7e01ea 100644 --- a/drivers/base/power/qos.c +++ b/drivers/base/power/qos.c @@ -856,7 +856,10 @@ int dev_pm_qos_update_user_latency_tolerance(struct device *dev, s32 val) struct dev_pm_qos_request *req; if (val < 0) { - ret = -EINVAL; + if (val == PM_QOS_LATENCY_TOLERANCE_NO_CONSTRAINT) + ret = 0; + else + ret = -EINVAL; goto out; } req = kzalloc(sizeof(*req), GFP_KERNEL);