From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752312AbcGYHF0 (ORCPT ); Mon, 25 Jul 2016 03:05:26 -0400 Received: from mail-pa0-f66.google.com ([209.85.220.66]:35262 "EHLO mail-pa0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751007AbcGYHFU (ORCPT ); Mon, 25 Jul 2016 03:05:20 -0400 From: Wei Yongjun To: Alessandro Zummo , Alexandre Belloni Cc: Wei Yongjun , rtc-linux@googlegroups.com, linux-kernel@vger.kernel.org Subject: [PATCH -next] rtc: at91sam9: Fix missing spin_lock_init() Date: Mon, 25 Jul 2016 07:05:11 +0000 Message-Id: <1469430311-8651-1-git-send-email-weiyj.lk@gmail.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The driver allocates the spinlock but not initialize it. Use spin_lock_init() on it to initialize it correctly. This is detected by Coccinelle semantic patch. Signed-off-by: Wei Yongjun --- drivers/rtc/rtc-at91sam9.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/rtc/rtc-at91sam9.c b/drivers/rtc/rtc-at91sam9.c index 99732e6..7418a76 100644 --- a/drivers/rtc/rtc-at91sam9.c +++ b/drivers/rtc/rtc-at91sam9.c @@ -375,6 +375,7 @@ static int at91_rtc_probe(struct platform_device *pdev) if (!rtc) return -ENOMEM; + spin_lock_init(&rtc->lock); rtc->irq = irq; /* platform setup code should have handled this; sigh */