Received: by 10.213.65.68 with SMTP id h4csp240149imn; Fri, 23 Mar 2018 03:41:02 -0700 (PDT) X-Google-Smtp-Source: AG47ELvlVn94W+YDduQE0Qct+1C21ofLNZzoX2DCnUDcXIcgE7ueKlybxUOwPlB1U73TF19uiWLo X-Received: by 10.98.224.93 with SMTP id f90mr12220902pfh.21.1521801662178; Fri, 23 Mar 2018 03:41:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521801662; cv=none; d=google.com; s=arc-20160816; b=BER5kM0Mazz+ccSE4YVLk9pY1ijvC31AJ+DKxsfuB5DiMeHkFoGO+ZZhiuOkZuvB7g CDSW7V/mdo9FS3SFHiTm0erz2xLW2iGjZyqNvtXOs8NCRA5mv2QJENV/uJuljLjy1UCF 7e/6ajnPWJBKOE2uA9xOFtYyw1J7BKPT7C1tYf9KfOQvspBGwPUCjZeS1PB3tEsxKFsG Ct8QBK7XLMNK68Bm6YR4EOyjI56y4+YO/HHPGsLCEWmqUbUTkaHG5AJHRjKLL1E5d+DR QacuRS7Hv8f58HcAtpqdCvS30hJ/CWxYj0l4eyMesCaRfg4/YMmwmuA64AGmzcgztzdd ngBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=6UPT6eIEWN0bKaBaqnp41y7dr4r+bzFzsNtRnTLiXBQ=; b=pECKwkgecHfrFbwuCUbXbHqIFZwh7TWphxyTMUFrKCODd8DAgC+huZke8JxUKEu/Ee AJL/vehMYxiWx7+3uEMoFu8Dhv/BC1sfmwKdYwMW/JmJ/oCj4uztBygowoTkU665VR08 r7lmgzA4Y18w/vMDVlCr06ZDaVBPld++yoe0cb6goKKCKjMQflaso3oPGhQaYv8UMGzr IMnXdqYllvg4oQ6QeMbnwqYjUghWF4zHWmseqP2/K8673wiZrZyOdc8bB1W/2GOlZywI 6FnjtBC/J/kow5G+yENR6X+PmNdPlJiJHCI2oAsF79IOssfj2lB+gkZSREqtzt15RSKu 8xAA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z14si1074396pgv.626.2018.03.23.03.40.47; Fri, 23 Mar 2018 03:41:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756403AbeCWKj7 (ORCPT + 99 others); Fri, 23 Mar 2018 06:39:59 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:46864 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933701AbeCWKQu (ORCPT ); Fri, 23 Mar 2018 06:16:50 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id F3E39D98; Fri, 23 Mar 2018 10:16:49 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Moritz Fischer , Alexandre Belloni , Sasha Levin Subject: [PATCH 4.4 71/97] rtc: ds1374: wdt: Fix stop/start ioctl always returning -EINVAL Date: Fri, 23 Mar 2018 10:54:58 +0100 Message-Id: <20180323094201.588834484@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180323094157.535925724@linuxfoundation.org> References: <20180323094157.535925724@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Moritz Fischer [ Upstream commit 538c08f4c89580fc644e2bc64e0a4b86c925da4e ] The WDIOC_SETOPTIONS case in the watchdog ioctl would alwayss falls through to the -EINVAL case. This is wrong since thew watchdog does actually get stopped or started correctly. Fixes: 920f91e50c5b ("drivers/rtc/rtc-ds1374.c: add watchdog support") Signed-off-by: Moritz Fischer Signed-off-by: Alexandre Belloni Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/rtc/rtc-ds1374.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/rtc/rtc-ds1374.c +++ b/drivers/rtc/rtc-ds1374.c @@ -548,14 +548,15 @@ static long ds1374_wdt_ioctl(struct file if (options & WDIOS_DISABLECARD) { pr_info("disable watchdog\n"); ds1374_wdt_disable(); + return 0; } if (options & WDIOS_ENABLECARD) { pr_info("enable watchdog\n"); ds1374_wdt_settimeout(wdt_margin); ds1374_wdt_ping(); + return 0; } - return -EINVAL; } return -ENOTTY;