aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pnp
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pnp')
-rw-r--r--drivers/pnp/card.c4
-rw-r--r--drivers/pnp/driver.c12
-rw-r--r--drivers/pnp/interface.c8
3 files changed, 14 insertions, 10 deletions
diff --git a/drivers/pnp/card.c b/drivers/pnp/card.c
index 97eeecfaef1b..3252662958d3 100644
--- a/drivers/pnp/card.c
+++ b/drivers/pnp/card.c
@@ -140,7 +140,7 @@ static void pnp_release_card(struct device *dmdev)
140} 140}
141 141
142 142
143static ssize_t pnp_show_card_name(struct device *dmdev, char *buf) 143static ssize_t pnp_show_card_name(struct device *dmdev, struct device_attribute *attr, char *buf)
144{ 144{
145 char *str = buf; 145 char *str = buf;
146 struct pnp_card *card = to_pnp_card(dmdev); 146 struct pnp_card *card = to_pnp_card(dmdev);
@@ -150,7 +150,7 @@ static ssize_t pnp_show_card_name(struct device *dmdev, char *buf)
150 150
151static DEVICE_ATTR(name,S_IRUGO,pnp_show_card_name,NULL); 151static DEVICE_ATTR(name,S_IRUGO,pnp_show_card_name,NULL);
152 152
153static ssize_t pnp_show_card_ids(struct device *dmdev, char *buf) 153static ssize_t pnp_show_card_ids(struct device *dmdev, struct device_attribute *attr, char *buf)
154{ 154{
155 char *str = buf; 155 char *str = buf;
156 struct pnp_card *card = to_pnp_card(dmdev); 156 struct pnp_card *card = to_pnp_card(dmdev);
diff --git a/drivers/pnp/driver.c b/drivers/pnp/driver.c
index d64c1ca4fa76..1d037c2a82ac 100644
--- a/drivers/pnp/driver.c
+++ b/drivers/pnp/driver.c
@@ -160,10 +160,16 @@ struct bus_type pnp_bus_type = {
160}; 160};
161 161
162 162
163static int count_devices(struct device * dev, void * c)
164{
165 int * count = c;
166 (*count)++;
167 return 0;
168}
169
163int pnp_register_driver(struct pnp_driver *drv) 170int pnp_register_driver(struct pnp_driver *drv)
164{ 171{
165 int count; 172 int count;
166 struct list_head *pos;
167 173
168 pnp_dbg("the driver '%s' has been registered", drv->name); 174 pnp_dbg("the driver '%s' has been registered", drv->name);
169 175
@@ -177,9 +183,7 @@ int pnp_register_driver(struct pnp_driver *drv)
177 /* get the number of initial matches */ 183 /* get the number of initial matches */
178 if (count >= 0){ 184 if (count >= 0){
179 count = 0; 185 count = 0;
180 list_for_each(pos,&drv->driver.devices){ 186 driver_for_each_device(&drv->driver, NULL, &count, count_devices);
181 count++;
182 }
183 } 187 }
184 return count; 188 return count;
185} 189}
diff --git a/drivers/pnp/interface.c b/drivers/pnp/interface.c
index 53fac8ba5d5c..a2d8ce7fef9c 100644
--- a/drivers/pnp/interface.c
+++ b/drivers/pnp/interface.c
@@ -205,7 +205,7 @@ static void pnp_print_option(pnp_info_buffer_t *buffer, char *space,
205} 205}
206 206
207 207
208static ssize_t pnp_show_options(struct device *dmdev, char *buf) 208static ssize_t pnp_show_options(struct device *dmdev, struct device_attribute *attr, char *buf)
209{ 209{
210 struct pnp_dev *dev = to_pnp_dev(dmdev); 210 struct pnp_dev *dev = to_pnp_dev(dmdev);
211 struct pnp_option * independent = dev->independent; 211 struct pnp_option * independent = dev->independent;
@@ -236,7 +236,7 @@ static ssize_t pnp_show_options(struct device *dmdev, char *buf)
236static DEVICE_ATTR(options,S_IRUGO,pnp_show_options,NULL); 236static DEVICE_ATTR(options,S_IRUGO,pnp_show_options,NULL);
237 237
238 238
239static ssize_t pnp_show_current_resources(struct device *dmdev, char *buf) 239static ssize_t pnp_show_current_resources(struct device *dmdev, struct device_attribute *attr, char *buf)
240{ 240{
241 struct pnp_dev *dev = to_pnp_dev(dmdev); 241 struct pnp_dev *dev = to_pnp_dev(dmdev);
242 int i, ret; 242 int i, ret;
@@ -308,7 +308,7 @@ static ssize_t pnp_show_current_resources(struct device *dmdev, char *buf)
308extern struct semaphore pnp_res_mutex; 308extern struct semaphore pnp_res_mutex;
309 309
310static ssize_t 310static ssize_t
311pnp_set_current_resources(struct device * dmdev, const char * ubuf, size_t count) 311pnp_set_current_resources(struct device * dmdev, struct device_attribute *attr, const char * ubuf, size_t count)
312{ 312{
313 struct pnp_dev *dev = to_pnp_dev(dmdev); 313 struct pnp_dev *dev = to_pnp_dev(dmdev);
314 char *buf = (void *)ubuf; 314 char *buf = (void *)ubuf;
@@ -444,7 +444,7 @@ pnp_set_current_resources(struct device * dmdev, const char * ubuf, size_t count
444static DEVICE_ATTR(resources,S_IRUGO | S_IWUSR, 444static DEVICE_ATTR(resources,S_IRUGO | S_IWUSR,
445 pnp_show_current_resources,pnp_set_current_resources); 445 pnp_show_current_resources,pnp_set_current_resources);
446 446
447static ssize_t pnp_show_current_ids(struct device *dmdev, char *buf) 447static ssize_t pnp_show_current_ids(struct device *dmdev, struct device_attribute *attr, char *buf)
448{ 448{
449 char *str = buf; 449 char *str = buf;
450 struct pnp_dev *dev = to_pnp_dev(dmdev); 450 struct pnp_dev *dev = to_pnp_dev(dmdev);