From patchwork Mon Jan 31 16:42:17 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Marc-Andr=C3=A9_H=C3=A9bert?= X-Patchwork-Id: 520341 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 p0VGgJmR029237 for ; Mon, 31 Jan 2011 16:42:19 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754160Ab1AaQmS (ORCPT ); Mon, 31 Jan 2011 11:42:18 -0500 Received: from mail-yi0-f46.google.com ([209.85.218.46]:55581 "EHLO mail-yi0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752299Ab1AaQmS (ORCPT ); Mon, 31 Jan 2011 11:42:18 -0500 Received: by yib18 with SMTP id 18so2038695yib.19 for ; Mon, 31 Jan 2011 08:42:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=B/nJf/vAIAo73O9bbDo9c20pdgNRXOYVVScpmkDO5zo=; b=p1CyAKSJI3wGU+4+8SNGtu3HW/v1DTJhffr9+IGgXvzRgVDVgmjlW7pywxvCzG5dzx H9v1+RPYSUyiQB8pAONs4G3481YIrxWP0UgN6BOEq+NCFzfXj1Zp9PbEePi/7rgCEod9 8xQXFhsI7RHPJfoRqDloPU9kmNrc6dTrOjz3o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=A8ZJhktzIzs9hxunojWoel6+rhJtg6xqz7/XMxfOciXk/LmKh77nNoVG02GzACpjzj 6a/8DetSa1foMt8oV1w79u4Dnmt1xx4R7PPN4y8+xH11Ga39cC4zAqpF7+UL8e4iTVlN JqaQ14HhYUK/QBVEOhlcuWa8lmrXtt11E/e8I= MIME-Version: 1.0 Received: by 10.151.51.9 with SMTP id d9mr8280830ybk.92.1296492137472; Mon, 31 Jan 2011 08:42:17 -0800 (PST) Received: by 10.146.84.19 with HTTP; Mon, 31 Jan 2011 08:42:17 -0800 (PST) Date: Mon, 31 Jan 2011 11:42:17 -0500 Message-ID: Subject: [PATCH] MMC: Fix the block device read only flag From: =?ISO-8859-1?Q?Marc=2DAndr=E9_H=E9bert?= To: linux-mmc 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]); Mon, 31 Jan 2011 16:42:22 +0000 (UTC) diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c index bfc8a8a..61d233a 100644 --- a/drivers/mmc/card/block.c +++ b/drivers/mmc/card/block.c @@ -621,6 +621,7 @@ static struct mmc_blk_data *mmc_blk_alloc(struct mmc_card *card) md->disk->private_data = md; md->disk->queue = md->queue.queue; md->disk->driverfs_dev = &card->dev; + set_disk_ro(md->disk, md->read_only); /*