From patchwork Wed Jan 27 03:36:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Martinez Canillas X-Patchwork-Id: 573831 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail-pf0-x239.google.com (mail-pf0-x239.google.com [IPv6:2607:f8b0:400e:c00::239]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 07722140BE0 for ; Wed, 27 Jan 2016 14:37:37 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.b=kPHiiHi6; dkim-atps=neutral Received: by mail-pf0-x239.google.com with SMTP id n128sf13672026pfn.1 for ; Tue, 26 Jan 2016 19:37:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=mime-version:from:to:cc:subject:date:message-id:in-reply-to :references:x-original-sender:x-original-authentication-results :reply-to:content-type:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive:sender :list-subscribe:list-unsubscribe; bh=/QyQlTsOOEQ1w4o7Ml52KoZt06WpRGQcfh0NU0t0L5w=; b=kPHiiHi6h3vioB8aSELExTO+s9r+lu4Oei4MvNriervagUoyHaIb+LT+DNeB2KHAj3 UVVWJ0MOIM4goc4TixcHa9j1942UBMKzacbMcvvLrdTilR5Z9Grg3Aap44B6mLql/God nMdCDNTv0/fbrRNZLmD1KmK2yTJkCBRr+01UeJyqYSikSwJbhXZLjipuGyML7TtjoGGi lVNaoHA+E90TAdalIkgGlZiNJUGzmb6w+Ciq55w4Au4TXgay5IGYZna7j6VjESEkJ7Ou mRXTAVdFGZnE6mq57t2jwCAFkNIoSciSlEpTqWi77I5x/cOY1s6+BlfFa+c2Vcvi1IJo ntxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:to:cc:subject:date:message-id :in-reply-to:references:x-original-sender :x-original-authentication-results:reply-to:content-type:precedence :mailing-list:list-id:x-spam-checked-in-group:list-post:list-help :list-archive:sender:list-subscribe:list-unsubscribe; bh=/QyQlTsOOEQ1w4o7Ml52KoZt06WpRGQcfh0NU0t0L5w=; b=POylq7ZRgmQo+1+LfHlZyMgVtpR+V8mE/ucaedT2c6x0ARc2Hh+qQOkyxLdTxL/tEc BKsqBTR8kRlnMVgYfwtV9pjJLHmM76MetBZlSnb9Ht4ooPdILLEIRq6j/9dVIC0k4PT2 Fwtynd991M0MKHDpygUiHV2HI3HtCxSmB542FD0fopU0Ky/i2u0FwOLxkLoSbuK0gZaM a1M+5emcQvPETKAK6QvNlUvKOCveA0DGp/VUvQ87afw6WJ7Rv6Mb3iryX7t6ee5sy9jX EFPCP3i6Z616yP5lNtX69+Di5+T3ZBNx9/PD4Mff5gJLBsTABrANw3CiSbzNFZywM3J5 4h/g== X-Gm-Message-State: AG10YORDSx+gftrAUbL2/fkST26uSZk9KSOjYKtuNxqhSWWNA9Fg9ASuw4eJKaf0efRufQ== X-Received: by 10.50.138.138 with SMTP id qq10mr692527igb.10.1453865855687; Tue, 26 Jan 2016 19:37:35 -0800 (PST) MIME-Version: 1.0 X-BeenThere: rtc-linux@googlegroups.com Received: by 10.107.148.134 with SMTP id w128ls480886iod.20.gmail; Tue, 26 Jan 2016 19:37:35 -0800 (PST) X-Received: by 10.107.163.208 with SMTP id m199mr26088452ioe.30.1453865855512; Tue, 26 Jan 2016 19:37:35 -0800 (PST) Received: from lists.s-osg.org (lists.s-osg.org. [54.187.51.154]) by gmr-mx.google.com with ESMTP id tn7si519614pac.1.2016.01.26.19.37.35 for ; Tue, 26 Jan 2016 19:37:35 -0800 (PST) Received-SPF: neutral (google.com: 54.187.51.154 is neither permitted nor denied by best guess record for domain of javier@osg.samsung.com) client-ip=54.187.51.154; Received: from sauron.localdomain (unknown [181.120.163.117]) by lists.s-osg.org (Postfix) with ESMTPSA id BFB4B4632A; Tue, 26 Jan 2016 19:37:31 -0800 (PST) From: Javier Martinez Canillas To: linux-kernel@vger.kernel.org Cc: Kukjin Kim , rtc-linux@googlegroups.com, Andi Shyti , Chanwoo Choi , Alexandre Belloni , Krzysztof Kozlowski , Laxman Dewangan , linux-samsung-soc@vger.kernel.org, Javier Martinez Canillas Subject: [rtc-linux] [PATCH v4 07/10] rtc: max77686: Fix unsupported year message Date: Wed, 27 Jan 2016 00:36:43 -0300 Message-Id: <1453865806-4661-8-git-send-email-javier@osg.samsung.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1453865806-4661-1-git-send-email-javier@osg.samsung.com> References: <1453865806-4661-1-git-send-email-javier@osg.samsung.com> X-Original-Sender: javier@osg.samsung.com X-Original-Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 54.187.51.154 is neither permitted nor denied by best guess record for domain of javier@osg.samsung.com) smtp.mailfrom=javier@osg.samsung.com Reply-To: rtc-linux@googlegroups.com Precedence: list Mailing-list: list rtc-linux@googlegroups.com; contact rtc-linux+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: rtc-linux@googlegroups.com X-Google-Group-Id: 712029733259 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , The max77686 RTC only supports a range of 99 years so instead of using year 1900 as the base, the year 2000 is used. This means that 1900 to 1999 are unsupported years. The driver was printing a warning for those values but was returning a error so for consistency, print an error message instead and don't say that a year 2000 is assumed, since the year is not set. Also, it is better to use dev_* log functions instead of pr_* to print information about the device in the kernel log in a standardized way. This also allows to remove the local pr_fmt() defined macro. Suggested-by: Krzysztof Kozlowski Signed-off-by: Javier Martinez Canillas Reviewed-by: Krzysztof Kozlowski --- Changes in v4: - Use dev_err() instead of dev_warn() and change message. Suggested by Krzysztof Kozlowski and Andi Shyti. - Change subject line and commit message of patch #7. - Removed Laxman Dewangan's Acked-by tag since the patch changed. Changes in v3: - Add Laxman Dewangan's Acked-by tag to patch #7. Changes in v2: None drivers/rtc/rtc-max77686.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/rtc/rtc-max77686.c b/drivers/rtc/rtc-max77686.c index a9a4ee0f0f41..bbb06dd2ee35 100644 --- a/drivers/rtc/rtc-max77686.c +++ b/drivers/rtc/rtc-max77686.c @@ -12,8 +12,6 @@ * */ -#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - #include #include #include @@ -249,7 +247,7 @@ static int max77686_rtc_tm_to_data(struct rtc_time *tm, u8 *data, data[RTC_YEAR] = tm->tm_year > 100 ? (tm->tm_year - 100) : 0; if (tm->tm_year < 100) { - pr_warn("RTC cannot handle the year %d. Assume it's 2000.\n", + dev_err(info->dev, "RTC cannot handle the year %d.\n", 1900 + tm->tm_year); return -EINVAL; }