diff options
author | Tony Jones <tonyj@suse.de> | 2008-02-21 18:13:36 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-04-19 22:10:33 -0400 |
commit | ee959b00c335d7780136c5abda37809191fe52c3 (patch) | |
tree | 7775f3b274fd8caf5e7e5154fea89e96f2babd94 /drivers/scsi/scsi_transport_srp.c | |
parent | 56d110e852b0b1c85ad6c9bfe1cb4473ceb16402 (diff) |
SCSI: convert struct class_device to struct device
It's big, but there doesn't seem to be a way to split it up smaller...
Signed-off-by: Tony Jones <tonyj@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Cc: Roland Dreier <rolandd@cisco.com>
Cc: Sean Hefty <sean.hefty@intel.com>
Cc: Hal Rosenstock <hal.rosenstock@gmail.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/scsi/scsi_transport_srp.c')
-rw-r--r-- | drivers/scsi/scsi_transport_srp.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/drivers/scsi/scsi_transport_srp.c b/drivers/scsi/scsi_transport_srp.c index 2445c98ae95e..8a7af951d98a 100644 --- a/drivers/scsi/scsi_transport_srp.c +++ b/drivers/scsi/scsi_transport_srp.c | |||
@@ -44,20 +44,20 @@ struct srp_internal { | |||
44 | struct scsi_transport_template t; | 44 | struct scsi_transport_template t; |
45 | struct srp_function_template *f; | 45 | struct srp_function_template *f; |
46 | 46 | ||
47 | struct class_device_attribute *host_attrs[SRP_HOST_ATTRS + 1]; | 47 | struct device_attribute *host_attrs[SRP_HOST_ATTRS + 1]; |
48 | 48 | ||
49 | struct class_device_attribute *rport_attrs[SRP_RPORT_ATTRS + 1]; | 49 | struct device_attribute *rport_attrs[SRP_RPORT_ATTRS + 1]; |
50 | struct class_device_attribute private_rport_attrs[SRP_RPORT_ATTRS]; | 50 | struct device_attribute private_rport_attrs[SRP_RPORT_ATTRS]; |
51 | struct transport_container rport_attr_cont; | 51 | struct transport_container rport_attr_cont; |
52 | }; | 52 | }; |
53 | 53 | ||
54 | #define to_srp_internal(tmpl) container_of(tmpl, struct srp_internal, t) | 54 | #define to_srp_internal(tmpl) container_of(tmpl, struct srp_internal, t) |
55 | 55 | ||
56 | #define dev_to_rport(d) container_of(d, struct srp_rport, dev) | 56 | #define dev_to_rport(d) container_of(d, struct srp_rport, dev) |
57 | #define transport_class_to_srp_rport(cdev) dev_to_rport((cdev)->dev) | 57 | #define transport_class_to_srp_rport(dev) dev_to_rport((dev)->parent) |
58 | 58 | ||
59 | static int srp_host_setup(struct transport_container *tc, struct device *dev, | 59 | static int srp_host_setup(struct transport_container *tc, struct device *dev, |
60 | struct class_device *cdev) | 60 | struct device *cdev) |
61 | { | 61 | { |
62 | struct Scsi_Host *shost = dev_to_shost(dev); | 62 | struct Scsi_Host *shost = dev_to_shost(dev); |
63 | struct srp_host_attrs *srp_host = to_srp_host_attrs(shost); | 63 | struct srp_host_attrs *srp_host = to_srp_host_attrs(shost); |
@@ -73,7 +73,7 @@ static DECLARE_TRANSPORT_CLASS(srp_rport_class, "srp_remote_ports", | |||
73 | NULL, NULL, NULL); | 73 | NULL, NULL, NULL); |
74 | 74 | ||
75 | #define SETUP_TEMPLATE(attrb, field, perm, test, ro_test, ro_perm) \ | 75 | #define SETUP_TEMPLATE(attrb, field, perm, test, ro_test, ro_perm) \ |
76 | i->private_##attrb[count] = class_device_attr_##field; \ | 76 | i->private_##attrb[count] = dev_attr_##field; \ |
77 | i->private_##attrb[count].attr.mode = perm; \ | 77 | i->private_##attrb[count].attr.mode = perm; \ |
78 | if (ro_test) { \ | 78 | if (ro_test) { \ |
79 | i->private_##attrb[count].attr.mode = ro_perm; \ | 79 | i->private_##attrb[count].attr.mode = ro_perm; \ |
@@ -100,13 +100,14 @@ static DECLARE_TRANSPORT_CLASS(srp_rport_class, "srp_remote_ports", | |||
100 | "%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x" | 100 | "%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x" |
101 | 101 | ||
102 | static ssize_t | 102 | static ssize_t |
103 | show_srp_rport_id(struct class_device *cdev, char *buf) | 103 | show_srp_rport_id(struct device *dev, struct device_attribute *attr, |
104 | char *buf) | ||
104 | { | 105 | { |
105 | struct srp_rport *rport = transport_class_to_srp_rport(cdev); | 106 | struct srp_rport *rport = transport_class_to_srp_rport(dev); |
106 | return sprintf(buf, SRP_PID_FMT "\n", SRP_PID(rport)); | 107 | return sprintf(buf, SRP_PID_FMT "\n", SRP_PID(rport)); |
107 | } | 108 | } |
108 | 109 | ||
109 | static CLASS_DEVICE_ATTR(port_id, S_IRUGO, show_srp_rport_id, NULL); | 110 | static DEVICE_ATTR(port_id, S_IRUGO, show_srp_rport_id, NULL); |
110 | 111 | ||
111 | static const struct { | 112 | static const struct { |
112 | u32 value; | 113 | u32 value; |
@@ -117,9 +118,10 @@ static const struct { | |||
117 | }; | 118 | }; |
118 | 119 | ||
119 | static ssize_t | 120 | static ssize_t |
120 | show_srp_rport_roles(struct class_device *cdev, char *buf) | 121 | show_srp_rport_roles(struct device *dev, struct device_attribute *attr, |
122 | char *buf) | ||
121 | { | 123 | { |
122 | struct srp_rport *rport = transport_class_to_srp_rport(cdev); | 124 | struct srp_rport *rport = transport_class_to_srp_rport(dev); |
123 | int i; | 125 | int i; |
124 | char *name = NULL; | 126 | char *name = NULL; |
125 | 127 | ||
@@ -131,7 +133,7 @@ show_srp_rport_roles(struct class_device *cdev, char *buf) | |||
131 | return sprintf(buf, "%s\n", name ? : "unknown"); | 133 | return sprintf(buf, "%s\n", name ? : "unknown"); |
132 | } | 134 | } |
133 | 135 | ||
134 | static CLASS_DEVICE_ATTR(roles, S_IRUGO, show_srp_rport_roles, NULL); | 136 | static DEVICE_ATTR(roles, S_IRUGO, show_srp_rport_roles, NULL); |
135 | 137 | ||
136 | static void srp_rport_release(struct device *dev) | 138 | static void srp_rport_release(struct device *dev) |
137 | { | 139 | { |