Merge https://gitlab.denx.de/u-boot/custodians/u-boot-fsl-qoriq
[oweals/u-boot.git] / drivers / rtc / mc13xxx-rtc.c
index e79f4621d3f9e8157e5861b3382a91181031b4dc..6c2aef89758bbf5a65ef79fa91ebbcc5f9fed195 100644 (file)
@@ -1,23 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright (C) 2008, Guennadi Liakhovetski <lg@denx.de>
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
  */
 
 #include <common.h>
@@ -52,7 +35,7 @@ int rtc_get(struct rtc_time *rtc)
 
        tim = day1 * 86400 + time;
 
-       to_tm(tim, rtc);
+       rtc_to_tm(tim, rtc);
 
        rtc->tm_yday = 0;
        rtc->tm_isdst = 0;
@@ -67,8 +50,7 @@ int rtc_set(struct rtc_time *rtc)
        if (!p)
                return -1;
 
-       time = mktime(rtc->tm_year, rtc->tm_mon, rtc->tm_mday,
-                     rtc->tm_hour, rtc->tm_min, rtc->tm_sec);
+       time = rtc_mktime(rtc);
        day = time / 86400;
        time %= 86400;