Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp8472862ybl; Thu, 16 Jan 2020 17:33:05 -0800 (PST) X-Google-Smtp-Source: APXvYqwtrFVlPPAJN5LZRNgtOFjgIJIqqOhHWonj1GO5hdzdjffWF7oS7cy3bc9wUrKm43uUM5G2 X-Received: by 2002:a05:6830:20cf:: with SMTP id z15mr4462221otq.277.1579224784889; Thu, 16 Jan 2020 17:33:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579224784; cv=none; d=google.com; s=arc-20160816; b=yr70r/U/F4Rn6JXNKW1FoE9XsiwgzRhc49+O0mIY+AcxWrpPW7mNBzBbdMVfUm/DnA RChnmvdcJG0oB0I/WFSrNQJwebCYTQWwkHaanpMdDS0G4gDOYC1Fxpy1wvJ+a62dQV14 3+6/46mZHI7CFNJi5iCSGM964Ar0x2ivH12N5pO9CO2VnGWAxwbr0bNv68VCpDkB8Gwg CWFfd/Q8FWb2Uz4e0ZwG9b+mDuIil8cb8y+T3b7EiVrRFLffTayp3aRBaExMfCkSyaZk XRRUjmVfuP8CQRsfFcvlsPTOru7VLtAxfrVe9pQOQjf+/BA24bFDfhLAE/N4J1h11N0c sZOQ== 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=2z6Y2UzwGnVXz6Sn8yyc1ARVFUWvWpL52dVqbBHA8v0=; b=eg5DqEXu9adHIBSar1CIedbQXThWM5DaF6/JCF9Em+IldQIIr2l2bf3+/L/w03j8ya 4y7ZUsAYNNTFUhfM908OHSCvGzIh7o+Z0yHg1QCHHVh8jhIU28nyoowgTNL222jVioih BFOaoO7T0lI/yM8cd8aF4MtZ6B9qptLna2Ovmp8vIFFFf5ZYHoSb+Mz2Pai50iI9eIBs ncqqmbQPiZrvmulHbxbYID5jpMnsycmEcet8KPEpSdAOjoyayawEjO4tCrYFyDLZX8/k QVjAz2W11kY2lU9MWih/MjqEAhf9XLIQEPRO/g0i8cVsAr1KAU5E/sIG8t8YMtSMMPxV IQyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=XGuc1HuI; 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 f17si2188539oti.190.2020.01.16.17.32.52; Thu, 16 Jan 2020 17:33:04 -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=XGuc1HuI; 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 S2389276AbgAPX0m (ORCPT + 99 others); Thu, 16 Jan 2020 18:26:42 -0500 Received: from mail.kernel.org ([198.145.29.99]:56642 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388596AbgAPX0Q (ORCPT ); Thu, 16 Jan 2020 18:26:16 -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 7402E2072B; Thu, 16 Jan 2020 23:26:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579217175; bh=04qAfMYFUg3t8AAxzMc2ejr9JJEv682j1pDNk6mf4nE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XGuc1HuIrV9Y0Idnr0Pu/STJINTvBCM9XhGViWwEbloyBUP1soNfKWxEpV/isH0T6 5ZzsVh7dR34fuXhngicC7vsvnQmQ+UJdO8tF6YykfZNnG96PMUiZ1Cgi9bGh3zMjmZ l7CVGccc5110jZh/vdw9gHRrflGZLauxfLLHDcjw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kars de Jong , Geert Uytterhoeven , Alexandre Belloni Subject: [PATCH 5.4 178/203] rtc: msm6242: Fix reading of 10-hour digit Date: Fri, 17 Jan 2020 00:18:15 +0100 Message-Id: <20200116231759.995926476@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200116231745.218684830@linuxfoundation.org> References: <20200116231745.218684830@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: Kars de Jong commit e34494c8df0cd96fc432efae121db3212c46ae48 upstream. The driver was reading the wrong register as the 10-hour digit due to a misplaced ')'. It was in fact reading the 1-second digit register due to this bug. Also remove the use of a magic number for the hour mask and use the define for it which was already present. Fixes: 4f9b9bba1dd1 ("rtc: Add an RTC driver for the Oki MSM6242") Tested-by: Kars de Jong Signed-off-by: Kars de Jong Link: https://lore.kernel.org/r/20191116110548.8562-1-jongk@linux-m68k.org Reviewed-by: Geert Uytterhoeven Signed-off-by: Alexandre Belloni Signed-off-by: Greg Kroah-Hartman --- drivers/rtc/rtc-msm6242.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/rtc/rtc-msm6242.c +++ b/drivers/rtc/rtc-msm6242.c @@ -133,7 +133,8 @@ static int msm6242_read_time(struct devi msm6242_read(priv, MSM6242_SECOND1); tm->tm_min = msm6242_read(priv, MSM6242_MINUTE10) * 10 + msm6242_read(priv, MSM6242_MINUTE1); - tm->tm_hour = (msm6242_read(priv, MSM6242_HOUR10 & 3)) * 10 + + tm->tm_hour = (msm6242_read(priv, MSM6242_HOUR10) & + MSM6242_HOUR10_HR_MASK) * 10 + msm6242_read(priv, MSM6242_HOUR1); tm->tm_mday = msm6242_read(priv, MSM6242_DAY10) * 10 + msm6242_read(priv, MSM6242_DAY1);