Commit b55cdbfa authored by Russell King's avatar Russell King

[PCMCIA] Clean up class device attribute registration and fix build error

parent b45aa330
...@@ -47,8 +47,8 @@ static ssize_t pccard_show_type(struct class_device *dev, char *buf) ...@@ -47,8 +47,8 @@ static ssize_t pccard_show_type(struct class_device *dev, char *buf)
int val; int val;
struct pcmcia_socket *s = to_socket(dev); struct pcmcia_socket *s = to_socket(dev);
if (!(s->state & SOCKET_PRESENT)) if (!(s->state & SOCKET_PRESENT))
return -ENODEV; return -ENODEV;
s->ops->get_status(s, &val); s->ops->get_status(s, &val);
if (val & SS_CARDBUS) if (val & SS_CARDBUS)
return sprintf(buf, "32-bit\n"); return sprintf(buf, "32-bit\n");
...@@ -63,8 +63,8 @@ static ssize_t pccard_show_voltage(struct class_device *dev, char *buf) ...@@ -63,8 +63,8 @@ static ssize_t pccard_show_voltage(struct class_device *dev, char *buf)
int val; int val;
struct pcmcia_socket *s = to_socket(dev); struct pcmcia_socket *s = to_socket(dev);
if (!(s->state & SOCKET_PRESENT)) if (!(s->state & SOCKET_PRESENT))
return -ENODEV; return -ENODEV;
s->ops->get_status(s, &val); s->ops->get_status(s, &val);
if (val & SS_3VCARD) if (val & SS_3VCARD)
return sprintf(buf, "3.3V\n"); return sprintf(buf, "3.3V\n");
...@@ -134,21 +134,24 @@ static struct class_device_attribute *pccard_socket_attributes[] = { ...@@ -134,21 +134,24 @@ static struct class_device_attribute *pccard_socket_attributes[] = {
static int __devinit pccard_sysfs_add_socket(struct class_device *class_dev) static int __devinit pccard_sysfs_add_socket(struct class_device *class_dev)
{ {
unsigned int i; struct class_device_attribute **attr;
int ret = 0; int ret = 0;
for (i = 0; (attr = pccard_socket_attributes[i]); i++) {
if ((ret = class_device_create_file(class_dev, attr))) for (attr = pccard_socket_attributes; *attr; attr++) {
return (ret); ret = class_device_create_file(class_dev, *attr);
} if (ret)
return (ret); break;
}
return ret;
} }
static void __devexit pccard_sysfs_remove_socket(struct class_device *class_dev) static void __devexit pccard_sysfs_remove_socket(struct class_device *class_dev)
{ {
struct class_device_attribute *attr; struct class_device_attribute **attr;
unsigned int i;
for (i = 0; (attr = pccard_socket_attributes[i]); i++) for (attr = pccard_socket_attributes; *attr; attr++)
class_device_remove_file(class_dev, attr); class_device_remove_file(class_dev, *attr);
} }
struct class_interface pccard_sysfs_interface = { struct class_interface pccard_sysfs_interface = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment