Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp677451ybv; Thu, 13 Feb 2020 07:36:52 -0800 (PST) X-Google-Smtp-Source: APXvYqyBmP63aarXg1Jxj1eRY8NrbdgUkioIiVxWJho5oIwGXp1mTTrU6TmReNv0QqwglQ09zbE9 X-Received: by 2002:aca:7244:: with SMTP id p65mr3168691oic.50.1581608212435; Thu, 13 Feb 2020 07:36:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581608212; cv=none; d=google.com; s=arc-20160816; b=r5hbc9CbZpSzDTwQ96p+VWxKW0TN4NZeP0nzTLx3TrJoZ92nFKENDebr5E06tdOFLp o2B2bpej37spBGUERdSDPjbqILJYnNemCbS9lRoSiw/iZRIRLj8HaknV4x+wnjrbB6T3 g0eZSmvaefxIhEz5b36e1ggnqSSt5bXNS01EwZjeAKGzUPTEGz18SAggdZRcq9XfTqe1 D1445K7NkzjPwYT4q3LP8EJRAJSdh3qETcbQ5k5zM0Zoaoux+ufoVwqxHium73Ie+IJ6 QB/232jGJHz01zZ+U9TeXyuOT2w5hj/DAxDq6WuFJeRzfWAufhg7U9JmPkYwGox0oX4R rQCQ== 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=3BhsOB6Dy6GAhzreObBtj/Xnpo/9MK7Npqj1Mnjqkzo=; b=D9D6KqvSwubWJmqiX+wvHKaZ755AQVouAVfrj88TB/LZSWbLREwIRtfRcnttGbGJrp Pyz9RHyNanX/1ZgtQMgqyz2rhFLqocGMsv3lPlKbZ1Pwp/3U+IJtVvVKOFYjUWXprWo5 x9WCPDP14o9FaBG2B3A8sijzmRkrRr9El4zSZyc6rroautNKrEbsxynDibstHjUi6ZjK nN4yFVP2A48ls+CAGriK5EqysMVlHOr8I5EuPmnEoS4f8nhfFrOe246qUXlbtYxy6DL2 s60vfmnye9bTYsursh+VUJcMkL52ZUeGAC9mWh/40DVPqJT0jm2SyYCTh9Z4IN2CSN6E SFpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=cDurxpJ5; 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 w5si1402089otm.45.2020.02.13.07.36.39; Thu, 13 Feb 2020 07:36:52 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=cDurxpJ5; 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 S2387928AbgBMPaT (ORCPT + 99 others); Thu, 13 Feb 2020 10:30:19 -0500 Received: from mail.kernel.org ([198.145.29.99]:49450 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728162AbgBMP1O (ORCPT ); Thu, 13 Feb 2020 10:27:14 -0500 Received: from localhost (unknown [104.132.1.104]) (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 7777E2168B; Thu, 13 Feb 2020 15:27:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581607633; bh=zV/QW4fl9Cuxy5M6xglKsBrt77kyVjIW5pP/yHdZHpA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cDurxpJ5ag4wQ4eby0WNsQyRWScChg8yGDzfT2Q4RmIAr1iLaTcQ59znPtoTX9Tp+ QYjf+5CYnBQ47l4DN+xsimfZ7Xmje+6xB48eofl1+8afRZyHMwGltf9Z4iKPmqM0xM 1jCtu43BNfHCqVD1QdaCyZnQF5/WPXvjf5bO1OI0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Paul Kocialkowski , Alexandre Belloni Subject: [PATCH 5.4 35/96] rtc: hym8563: Return -EINVAL if the time is known to be invalid Date: Thu, 13 Feb 2020 07:20:42 -0800 Message-Id: <20200213151852.676420303@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200213151839.156309910@linuxfoundation.org> References: <20200213151839.156309910@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: Paul Kocialkowski commit f236a2a2ebabad0848ad0995af7ad1dc7029e895 upstream. The current code returns -EPERM when the voltage loss bit is set. Since the bit indicates that the time value is not valid, return -EINVAL instead, which is the appropriate error code for this situation. Fixes: dcaf03849352 ("rtc: add hym8563 rtc-driver") Signed-off-by: Paul Kocialkowski Link: https://lore.kernel.org/r/20191212153111.966923-1-paul.kocialkowski@bootlin.com Signed-off-by: Alexandre Belloni Signed-off-by: Greg Kroah-Hartman --- drivers/rtc/rtc-hym8563.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/rtc/rtc-hym8563.c +++ b/drivers/rtc/rtc-hym8563.c @@ -97,7 +97,7 @@ static int hym8563_rtc_read_time(struct if (!hym8563->valid) { dev_warn(&client->dev, "no valid clock/calendar values available\n"); - return -EPERM; + return -EINVAL; } ret = i2c_smbus_read_i2c_block_data(client, HYM8563_SEC, 7, buf);