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=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 46D62C43603 for ; Wed, 11 Dec 2019 15:17:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 14C2420663 for ; Wed, 11 Dec 2019 15:17:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576077453; bh=80j/E0KDL2Dkz6xUpS+snG/edEeZDfUDIosDXSbukLU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=LPBSMZO6mCjwB3y7PwxkD59MXROHTbQvQU89dYxJVIRKVQ1MRKlkN9rSzGp7vNecD Ar7Y5v32VDcx1yrwDE3CXari5SjfP0Szr6s22W91WvsXxYGgDQpiWWDjWf8a4ubb/f JoCgFIQb30gihu/8DyY6NksGvnEv1L2D6MGI4pyg= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732026AbfLKPRb (ORCPT ); Wed, 11 Dec 2019 10:17:31 -0500 Received: from mail.kernel.org ([198.145.29.99]:44928 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732022AbfLKPRa (ORCPT ); Wed, 11 Dec 2019 10:17:30 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 100D92073D; Wed, 11 Dec 2019 15:17:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576077449; bh=80j/E0KDL2Dkz6xUpS+snG/edEeZDfUDIosDXSbukLU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=clnWkEb+of9dEXheeWhMPuM6rCUHKFFjSLLVHHRHnT2ch2NUMMj+7UVH9AxLqJd+P 0Jqs7+R6JRmfZs5Cb5j3tt9IkiuF281aMzDXdvXozLlCZNvtrZtJpUmMxeBL7oWdEW 6GHj1QMfvSjupG5UXHSOqFXcryqxVEPjFRmAtoWE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christophe JAILLET , Chanwoo Choi , Alexandre Belloni , Sasha Levin Subject: [PATCH 4.19 044/243] rtc: max77686: Fix the returned value in case of error in max77686_rtc_read_time() Date: Wed, 11 Dec 2019 16:03:26 +0100 Message-Id: <20191211150342.097176053@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191211150339.185439726@linuxfoundation.org> References: <20191211150339.185439726@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: Christophe JAILLET [ Upstream commit b28cc6cec3d814f5184cbebb2d1f987e769f534a ] In case of error, we return 0. This is spurious and not consistent with the other functions of the driver. Commit e115a2bf1426 has modified more than what is said in the commit message. Reverse part of it znd return an error when needed, as it was previously. Fixes: e115a2bf1426 ("rtc: max77686: stop validating rtc_time in .read_time") Signed-off-by: Christophe JAILLET Reviewed-by: Chanwoo Choi Signed-off-by: Alexandre Belloni Signed-off-by: Sasha Levin --- drivers/rtc/rtc-max77686.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/rtc/rtc-max77686.c b/drivers/rtc/rtc-max77686.c index 8a60900d6b8b5..4aff349ae301a 100644 --- a/drivers/rtc/rtc-max77686.c +++ b/drivers/rtc/rtc-max77686.c @@ -360,7 +360,7 @@ static int max77686_rtc_read_time(struct device *dev, struct rtc_time *tm) out: mutex_unlock(&info->lock); - return 0; + return ret; } static int max77686_rtc_set_time(struct device *dev, struct rtc_time *tm) -- 2.20.1