mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 3/4] ata: make write support optional
Date: Fri,  8 Apr 2011 16:48:35 +0200	[thread overview]
Message-ID: <1302274116-9215-4-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1302274116-9215-1-git-send-email-s.hauer@pengutronix.de>

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/ata/Kconfig      |    4 ++++
 drivers/ata/disk_drive.c |    4 ++++
 2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index 05cba70..d7f4dcb 100644
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -8,6 +8,10 @@ if ATA
 
 comment "drive types"
 
+config ATA_WRITE
+	select BLOCK_WRITE
+	bool "support writing to ATA drives"
+
 config ATA_DISK
 	bool "disk drives"
 	help
diff --git a/drivers/ata/disk_drive.c b/drivers/ata/disk_drive.c
index 4ad5a7a..f526b1e 100644
--- a/drivers/ata/disk_drive.c
+++ b/drivers/ata/disk_drive.c
@@ -137,6 +137,7 @@ static int atablk_read(struct block_device *blk, void *buf, int block,
 	return atablk->intf->read(atablk->dev, block, num_blocks, buf);
 }
 
+#ifdef CONFIG_ATA_WRITE
 static int atablk_write(struct block_device *blk, const void *buf, int block,
 		int num_blocks)
 {
@@ -144,10 +145,13 @@ static int atablk_write(struct block_device *blk, const void *buf, int block,
 
 	return atablk->intf->write(atablk->dev, block, num_blocks, buf);
 }
+#endif
 
 static struct block_device_ops ataops = {
 	.read = atablk_read,
+#ifdef CONFIG_ATA_WRITE
 	.write = atablk_write,
+#endif
 };
 
 /**
-- 
1.7.2.3


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2011-04-08 14:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-08 14:48 Sascha Hauer
2011-04-08 14:48 ` [PATCH 1/4] add block support Sascha Hauer
2011-04-08 14:48 ` [PATCH 2/4] ata: use " Sascha Hauer
2011-04-08 14:48 ` Sascha Hauer [this message]
2011-04-08 14:48 ` [PATCH 4/4] mci: make write support optional Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1302274116-9215-4-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox