All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: linux-scsi@vger.kernel.org
Cc: scst-devel@lists.sourceforge.net,
	Fujita Tomonori <fujita.tomonori@lab.ntt.co.jp>,
	Brian King <brking@linux.vnet.ibm.com>,
	Robert Jennings <rcj@linux.vnet.ibm.com>
Subject: [SCSI] ibmvstgt: Remove sysfs attributes
Date: Thu, 23 Dec 2010 11:12:31 +0100	[thread overview]
Message-ID: <201012231112.31775.bvanassche@acm.org> (raw)

The sysfs attributes system_id, partition_number and unit address as
made available by the ibmvstgt driver based on SCST are not used by any
user space software, hence remove these.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Cc: Fujita Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Brian King <brking@linux.vnet.ibm.com>
Cc: Robert Jennings <rcj@linux.vnet.ibm.com>
---
 drivers/scsi/ibmvscsi/ibmvstgt.c |   60 +-------------------------------------
 1 files changed, 1 insertions(+), 59 deletions(-)

diff --git a/drivers/scsi/ibmvscsi/ibmvstgt.c b/drivers/scsi/ibmvscsi/ibmvstgt.c
index 9904c8c..d12e4e5 100644
--- a/drivers/scsi/ibmvscsi/ibmvstgt.c
+++ b/drivers/scsi/ibmvscsi/ibmvstgt.c
@@ -81,7 +81,6 @@ struct vio_port {
 	struct srp_target *target;
 
 	struct scst_session *sess;
-	struct device dev;
 	bool releasing;
 	bool enabled;
 };
@@ -1113,46 +1112,6 @@ out:
 	return res;
 }
 
-static ssize_t system_id_show(struct device *dev,
-			      struct device_attribute *attr, char *buf)
-{
-	return snprintf(buf, PAGE_SIZE, "%s\n", system_id);
-}
-
-static ssize_t partition_number_show(struct device *dev,
-				     struct device_attribute *attr, char *buf)
-{
-	return snprintf(buf, PAGE_SIZE, "%x\n", partition_number);
-}
-
-static ssize_t unit_address_show(struct device *dev,
-				  struct device_attribute *attr, char *buf)
-{
-	struct vio_port *vport = container_of(dev, struct vio_port, dev);
-	return snprintf(buf, PAGE_SIZE, "%x\n", vport->dma_dev->unit_address);
-}
-
-static struct class_attribute ibmvstgt_class_attrs[] = {
-	__ATTR_NULL,
-};
-
-static struct device_attribute ibmvstgt_attrs[] = {
-	__ATTR(system_id, S_IRUGO, system_id_show, NULL),
-	__ATTR(partition_number, S_IRUGO, partition_number_show, NULL),
-	__ATTR(unit_address, S_IRUGO, unit_address_show, NULL),
-	__ATTR_NULL,
-};
-
-static void ibmvstgt_dev_release(struct device *dev)
-{ }
-
-static struct class ibmvstgt_class = {
-	.name		= "ibmvstgt",
-	.dev_release	= ibmvstgt_dev_release,
-	.class_attrs	= ibmvstgt_class_attrs,
-	.dev_attrs	= ibmvstgt_attrs,
-};
-
 static struct scst_tgt_template ibmvstgt_template = {
 	.name			= TGT_NAME,
 	.owner			= THIS_MODULE,
@@ -1227,19 +1186,10 @@ static int ibmvstgt_probe(struct vio_dev *dev, const struct vio_device_id *id)
 	if (err)
 		goto free_srp_target;
 
-	vport->dev.class = &ibmvstgt_class;
-	vport->dev.parent = &dev->dev;
-	dev_set_name(&vport->dev, "ibmvstgt-%d",
-		     vport->dma_dev->unit_address);
-	if (device_register(&vport->dev))
-		goto destroy_crq_queue;
-
 	atomic_inc(&ibmvstgt_device_count);
 
 	return 0;
 
-destroy_crq_queue:
-	crq_queue_destroy(target);
 free_srp_target:
 	srp_target_free(target);
 unregister_target:
@@ -1263,7 +1213,6 @@ static int ibmvstgt_remove(struct vio_dev *dev)
 	atomic_dec(&ibmvstgt_device_count);
 
 	vport = target->ldata;
-	device_unregister(&vport->dev);
 	crq_queue_destroy(target);
 	srp_target_free(target);
 	scst_unregister_target(target->tgt);
@@ -1346,13 +1295,9 @@ static int __init ibmvstgt_init(void)
 	if (err)
 		goto out;
 
-	err = class_register(&ibmvstgt_class);
-	if (err)
-		goto out;
-
 	err = scst_register_target_template(&ibmvstgt_template);
 	if (err)
-		goto unregister_class;
+		goto out;
 
 	vtgtd = create_workqueue("ibmvtgtd");
 	if (!vtgtd)
@@ -1368,8 +1313,6 @@ destroy_wq:
 	destroy_workqueue(vtgtd);
 unregister_tgt:
 	scst_unregister_target_template(&ibmvstgt_template);
-unregister_class:
-	class_unregister(&ibmvstgt_class);
 out:
 	return err;
 }
@@ -1381,7 +1324,6 @@ static void __exit ibmvstgt_exit(void)
 	vio_unregister_driver(&ibmvstgt_driver);
 	destroy_workqueue(vtgtd);
 	scst_unregister_target_template(&ibmvstgt_template);
-	class_unregister(&ibmvstgt_class);
 }
 
 MODULE_DESCRIPTION("IBM Virtual SCSI Target");
-- 
1.7.1


                 reply	other threads:[~2010-12-23 10:12 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=201012231112.31775.bvanassche@acm.org \
    --to=bvanassche@acm.org \
    --cc=brking@linux.vnet.ibm.com \
    --cc=fujita.tomonori@lab.ntt.co.jp \
    --cc=linux-scsi@vger.kernel.org \
    --cc=rcj@linux.vnet.ibm.com \
    --cc=scst-devel@lists.sourceforge.net \
    /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.