From 8cb64cc71f1edc6b0d1c039654052fdc0e45f9f1 Mon Sep 17 00:00:00 2001 From: yliu79 Date: Wed, 22 May 2019 10:20:08 -0700 Subject: [PATCH] DM: remove unused function vrtc_nvram_read Change-Id: I0b8c42879256e53762aeb031f63fc043ae2d9128 Tracked-On: #3123 Signed-off-by: Ying Liu Acked-by: Anthony Xu --- devicemodel/hw/platform/rtc.c | 30 ------------------------------ devicemodel/include/rtc.h | 1 - 2 files changed, 31 deletions(-) diff --git a/devicemodel/hw/platform/rtc.c b/devicemodel/hw/platform/rtc.c index ea4b130b0..9965cc71f 100644 --- a/devicemodel/hw/platform/rtc.c +++ b/devicemodel/hw/platform/rtc.c @@ -850,36 +850,6 @@ vrtc_set_reg_a(struct vrtc *vrtc, uint8_t newval) } } -int -vrtc_nvram_read(struct vrtc *vrtc, int offset, uint8_t *retval) -{ - time_t basetime; - time_t curtime; - uint8_t *ptr; - - /* - * Allow all offsets in the RTC to be read. - */ - if (offset < 0 || offset >= sizeof(struct rtcdev)) - return -1; - - pthread_mutex_lock(&vrtc->mtx); - - /* - * Update RTC date/time fields if necessary. - */ - if (offset < 10 || offset == RTC_CENTURY) { - curtime = vrtc_curtime(vrtc, &basetime); - secs_to_rtc(curtime, vrtc, 0); - } - - ptr = (uint8_t *)(&vrtc->rtcdev); - *retval = ptr[offset]; - pthread_mutex_unlock(&vrtc->mtx); - - return 0; -} - int vrtc_nvram_write(struct vrtc *vrtc, int offset, uint8_t value) { diff --git a/devicemodel/include/rtc.h b/devicemodel/include/rtc.h index 08bfdbb5e..e743e8f59 100644 --- a/devicemodel/include/rtc.h +++ b/devicemodel/include/rtc.h @@ -48,7 +48,6 @@ void vrtc_deinit(struct vmctx *ctx); void vrtc_reset(struct vrtc *vrtc); time_t vrtc_get_time(struct vrtc *vrtc); int vrtc_set_time(struct vrtc *vrtc, time_t secs); -int vrtc_nvram_read(struct vrtc *vrtc, int offset, uint8_t *retval); int vrtc_nvram_write(struct vrtc *vrtc, int offset, uint8_t value); int vrtc_addr_handler(struct vmctx *ctx, int vcpu, int in, int port, int bytes, uint32_t *eax, void *arg);