From patchwork Sun Apr 15 13:35:18 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anatolij Gustschin X-Patchwork-Id: 152599 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail-lb0-f184.google.com (mail-lb0-f184.google.com [209.85.217.184]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 04C62B6FEC for ; Sun, 15 Apr 2012 23:35:24 +1000 (EST) Received: by lbbgf7 with SMTP id gf7sf2267474lbb.11 for ; Sun, 15 Apr 2012 06:35:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=beta; h=mime-version:x-beenthere:received-spf:from:to:cc:subject:date :message-id:x-mailer:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:x-google-group-id:list-post:list-help:list-archive:sender :list-subscribe:list-unsubscribe:content-type; bh=Pi5gBq/uu2YyN6j/vFIrguxVfCw42Lt8d3njteno8ts=; b=J/8ftAUoJZ3lM2914qaUz8ifnoeOKpIV9U+XaufygaUjehGPk7y2vU+L88nsdP+jgx GC7qHagSu/4jrOdeZ6URQwA0n2fUjo8v5M173bDdnAYV7gmKqd85F6oEgkWKfQPJhi1k TcDUf08E88TjvuiCn+wesbakrh+w6Chl9lITI= Received: by 10.216.143.40 with SMTP id k40mr230243wej.2.1334496918896; Sun, 15 Apr 2012 06:35:18 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: rtc-linux@googlegroups.com Received: by 10.180.87.234 with SMTP id bb10ls1360261wib.4.gmail; Sun, 15 Apr 2012 06:35:18 -0700 (PDT) Received: by 10.180.94.105 with SMTP id db9mr818759wib.2.1334496918405; Sun, 15 Apr 2012 06:35:18 -0700 (PDT) Received: by 10.180.94.105 with SMTP id db9mr818758wib.2.1334496918394; Sun, 15 Apr 2012 06:35:18 -0700 (PDT) Received: from mail-out.m-online.net (mail-out.m-online.net. [212.18.0.9]) by gmr-mx.google.com with ESMTPS id n1si2068249wiy.0.2012.04.15.06.35.18 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 15 Apr 2012 06:35:18 -0700 (PDT) Received-SPF: neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of agust@denx.de) client-ip=212.18.0.9; Received: from frontend1.mail.m-online.net (unknown [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 3VVtyF5nGxz4Kn99; Sun, 15 Apr 2012 15:35:17 +0200 (CEST) Received: from localhost (p4FDE7160.dip.t-dialin.net [79.222.113.96]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA id 3VVtyF4PzNz4KK6W; Sun, 15 Apr 2012 15:35:17 +0200 (CEST) From: Anatolij Gustschin To: rtc-linux@googlegroups.com Cc: Andrew Morton , Alessandro Zummo , Stefano Babic Subject: [rtc-linux] [PATCH] drivers/rtc/rtc-ds1307.c: Fix BUG shown with lock debugging enabled Date: Sun, 15 Apr 2012 15:35:18 +0200 Message-Id: <1334496918-17345-1-git-send-email-agust@denx.de> X-Mailer: git-send-email 1.7.1 X-Original-Sender: agust@denx.de X-Original-Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of agust@denx.de) smtp.mail=agust@denx.de Reply-To: rtc-linux@googlegroups.com Precedence: list Mailing-list: list rtc-linux@googlegroups.com; contact rtc-linux+owners@googlegroups.com List-ID: X-Google-Group-Id: 712029733259 List-Post: , List-Help: , List-Archive: Sender: rtc-linux@googlegroups.com List-Subscribe: , List-Unsubscribe: , Add struct bin_attribute initialization to fix the following bug: rtc-ds1307 3-0068: rtc core: registered ds1307 as rtc0 BUG: key cfb14fcc not in .data! ------------[ cut here ]------------ WARNING: at kernel/lockdep.c:2986 sysfs_add_file_mode+0x84/0xdc() Modules linked in: [] (unwind_backtrace+0x0/0xf8) from [] (warn_slowpath_common+0x4c/0x64) [] (warn_slowpath_common+0x4c/0x64) from [] (warn_slowpath_null+0x1c/0x24) [] (warn_slowpath_null+0x1c/0x24) from [] (sysfs_add_file_mode+0x84/0xdc) [] (sysfs_add_file_mode+0x84/0xdc) from [] (ds1307_probe+0x5e4/0x6ac) [] (ds1307_probe+0x5e4/0x6ac) from [] (i2c_device_probe+0xdc/0x108) [] (i2c_device_probe+0xdc/0x108) from [] (driver_probe_device+0x90/0x210) [] (driver_probe_device+0x90/0x210) from [] (__driver_attach+0x94/0x98) [] (__driver_attach+0x94/0x98) from [] (bus_for_each_dev+0x50/0x7c) [] (bus_for_each_dev+0x50/0x7c) from [] (bus_add_driver+0x184/0x244) [] (bus_add_driver+0x184/0x244) from [] (driver_register+0x78/0x12c) [] (driver_register+0x78/0x12c) from [] (i2c_register_driver+0x2c/0xb4) [] (i2c_register_driver+0x2c/0xb4) from [] (do_one_initcall+0x34/0x178) [] (do_one_initcall+0x34/0x178) from [] (kernel_init+0xdc/0x194) [] (kernel_init+0xdc/0x194) from [] (kernel_thread_exit+0x0/0x8) Since commit 6992f5334995af474c2b58d010d08bc597f0f2fe (sysfs: Use one lockdep class per sysfs attribute.) this initialization is required. Reported-by: Stefano Babic Signed-off-by: Anatolij Gustschin Cc: Alessandro Zummo Cc: Stefano Babic Acked-by: Wolfram Sang --- drivers/rtc/rtc-ds1307.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/drivers/rtc/rtc-ds1307.c b/drivers/rtc/rtc-ds1307.c index cd188ab..c293d0c 100644 --- a/drivers/rtc/rtc-ds1307.c +++ b/drivers/rtc/rtc-ds1307.c @@ -902,6 +902,7 @@ read_rtc: } ds1307->nvram->attr.name = "nvram"; ds1307->nvram->attr.mode = S_IRUGO | S_IWUSR; + sysfs_bin_attr_init(ds1307->nvram); ds1307->nvram->read = ds1307_nvram_read, ds1307->nvram->write = ds1307_nvram_write, ds1307->nvram->size = chip->nvram_size;