From patchwork Sat Apr 23 15:22:58 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rabin Vincent X-Patchwork-Id: 729131 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p3NFMZ1Q010846 for ; Sat, 23 Apr 2011 15:22:35 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754949Ab1DWPWe (ORCPT ); Sat, 23 Apr 2011 11:22:34 -0400 Received: from mail-pw0-f46.google.com ([209.85.160.46]:43669 "EHLO mail-pw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754708Ab1DWPWd (ORCPT ); Sat, 23 Apr 2011 11:22:33 -0400 Received: by pwi15 with SMTP id 15so681167pwi.19 for ; Sat, 23 Apr 2011 08:22:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:from:to:cc:subject:date:message-id :x-mailer; bh=f2dAjIXnvlqkeIB5BkZAPxHLsP0pi07HEM91gQcx6tk=; b=sJB3R1GEtKiyKnynRDZ4I45LtZgyYXSPNnGMk+ZiXC2DpHcKAEdVEHdWnq+z7uTf5T 3280CUPFgTmx9Y1tIxxhUqoFg4gjTmzywEEZF+bpADmrlZumwYw+0x/+K0xtIeyX2YOX /qWMCM4YvCKW+dyQJk0z1FfKzS6Sl0UdxUIVI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:from:to:cc:subject:date:message-id:x-mailer; b=U50nfJQhIaZBaKslbeZqELth9DlDGlcZ6uNg4f9KZomJy0QOaalm/C7J9LZRxAtIDs rURiLzx2RY4D9qwAzPAx4jPrhj4WJ5Por7yZavy9eohMg0yNQIvBKnBtDP9h+14FQup3 G7ZP1dM9nGpMNBz4XzUIrBf1oN02hSmGeDQUc= Received: by 10.68.7.41 with SMTP id g9mr3516049pba.148.1303572153246; Sat, 23 Apr 2011 08:22:33 -0700 (PDT) Received: from localhost.localdomain ([59.164.102.98]) by mx.google.com with ESMTPS id b4sm259795pbo.80.2011.04.23.08.22.28 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 23 Apr 2011 08:22:30 -0700 (PDT) From: Rabin Vincent To: cjb@laptop.org Cc: andreiw@motorola.com, linux-mmc@vger.kernel.org, Rabin Vincent Subject: [PATCH] mmc: block: init force_ro sysfs attribute Date: Sat, 23 Apr 2011 20:52:58 +0530 Message-Id: <1303572178-6349-1-git-send-email-rabin@rab.in> X-Mailer: git-send-email 1.7.4.1 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Sat, 23 Apr 2011 15:22:35 +0000 (UTC) To avoid lockdep warnings: BUG: key dc90a520 not in .data! ------------[ cut here ]------------ WARNING: at /home/rabin/kernel/arm/kernel/lockdep.c:2701 sysfs_add_file_mode+0x4c/0xb0() Modules linked in: [] (unwind_backtrace+0x0/0xe4) from [] (warn_slowpath_common+0x4c/0x64) [] (warn_slowpath_common+0x4c/0x64) from [] (warn_slowpath_null+0x18/0x1c) [] (warn_slowpath_null+0x18/0x1c) from [] (sysfs_add_file_mode+0x4c/0xb0) [] (sysfs_add_file_mode+0x4c/0xb0) from [] (mmc_add_disk+0x40/0x64) [] (mmc_add_disk+0x40/0x64) from [] (mmc_blk_probe+0x188/0x1fc) [] (mmc_blk_probe+0x188/0x1fc) from [] (mmc_bus_probe+0x14/0x18) ... Signed-off-by: Rabin Vincent --- drivers/mmc/card/block.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c index 9e30cf6..179a607 100644 --- a/drivers/mmc/card/block.c +++ b/drivers/mmc/card/block.c @@ -967,6 +967,7 @@ static int mmc_add_disk(struct mmc_blk_data *md) add_disk(md->disk); md->force_ro.show = force_ro_show; md->force_ro.store = force_ro_store; + sysfs_attr_init(&md->force_ro.attr); md->force_ro.attr.name = "force_ro"; md->force_ro.attr.mode = S_IRUGO | S_IWUSR; ret = device_create_file(disk_to_dev(md->disk), &md->force_ro);