From: James Bottomley <James.Bottomley@SteelEye.com>
To: SCSI Mailing List <linux-scsi@vger.kernel.org>
Subject: [PATCH] convert 53c700 driver to use change_queue_depth API
Date: Sat, 11 Dec 2004 18:54:07 -0600 [thread overview]
Message-ID: <1102812847.5232.6.camel@mulgrave> (raw)
rather than using an attribute override.
James
===== drivers/scsi/53c700.c 1.58 vs edited =====
--- 1.58/drivers/scsi/53c700.c 2004-10-20 19:41:52 -05:00
+++ edited/drivers/scsi/53c700.c 2004-12-11 17:48:57 -06:00
@@ -176,6 +176,7 @@
STATIC void NCR_700_chip_reset(struct Scsi_Host *host);
STATIC int NCR_700_slave_configure(struct scsi_device *SDpnt);
STATIC void NCR_700_slave_destroy(struct scsi_device *SDpnt);
+static int NCR_700_change_queue_depth(struct scsi_device *SDpnt, int depth);
STATIC struct device_attribute *NCR_700_dev_attrs[];
@@ -338,6 +339,7 @@
tpnt->use_clustering = ENABLE_CLUSTERING;
tpnt->slave_configure = NCR_700_slave_configure;
tpnt->slave_destroy = NCR_700_slave_destroy;
+ tpnt->change_queue_depth = NCR_700_change_queue_depth;
if(tpnt->name == NULL)
tpnt->name = "53c700";
@@ -2102,18 +2104,14 @@
/* to do here: deallocate memory */
}
-static ssize_t
-NCR_700_store_queue_depth(struct device *dev, const char *buf, size_t count)
+static int
+NCR_700_change_queue_depth(struct scsi_device *SDp, int depth)
{
- int depth;
-
- struct scsi_device *SDp = to_scsi_device(dev);
- depth = simple_strtoul(buf, NULL, 0);
if(depth > NCR_700_MAX_TAGS)
- return -EINVAL;
+ depth = NCR_700_MAX_TAGS;
scsi_adjust_queue_depth(SDp, MSG_ORDERED_TAG, depth);
- return count;
+ return depth;
}
static ssize_t
@@ -2124,14 +2122,6 @@
return snprintf(buf, 20, "%d\n", NCR_700_get_depth(SDp));
}
-static struct device_attribute NCR_700_queue_depth_attr = {
- .attr = {
- .name = "queue_depth",
- .mode = S_IWUSR,
- },
- .store = NCR_700_store_queue_depth,
-};
-
static struct device_attribute NCR_700_active_tags_attr = {
.attr = {
.name = "active_tags",
@@ -2141,7 +2131,6 @@
};
STATIC struct device_attribute *NCR_700_dev_attrs[] = {
- &NCR_700_queue_depth_attr,
&NCR_700_active_tags_attr,
NULL,
};
next reply other threads:[~2004-12-12 0:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-12-12 0:54 James Bottomley [this message]
2004-12-20 15:42 ` [PATCH] convert 53c700 driver to use change_queue_depth API Guennadi Liakhovetski
2004-12-20 16:04 ` Guennadi Liakhovetski
2004-12-22 16:53 ` James Bottomley
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=1102812847.5232.6.camel@mulgrave \
--to=james.bottomley@steeleye.com \
--cc=linux-scsi@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.