aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/base/core.c6
-rw-r--r--fs/sysfs/bin.c6
-rw-r--r--include/linux/debugfs.h7
-rw-r--r--include/linux/klist.h2
-rw-r--r--scripts/mod/file2alias.c17
5 files changed, 35 insertions, 3 deletions
diff --git a/drivers/base/core.c b/drivers/base/core.c
index 8079afca4972..55e530942ab0 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -777,10 +777,16 @@ static void device_remove_class_symlinks(struct device *dev)
777int dev_set_name(struct device *dev, const char *fmt, ...) 777int dev_set_name(struct device *dev, const char *fmt, ...)
778{ 778{
779 va_list vargs; 779 va_list vargs;
780 char *s;
780 781
781 va_start(vargs, fmt); 782 va_start(vargs, fmt);
782 vsnprintf(dev->bus_id, sizeof(dev->bus_id), fmt, vargs); 783 vsnprintf(dev->bus_id, sizeof(dev->bus_id), fmt, vargs);
783 va_end(vargs); 784 va_end(vargs);
785
786 /* ewww... some of these buggers have / in the name... */
787 while ((s = strchr(dev->bus_id, '/')))
788 *s = '!';
789
784 return 0; 790 return 0;
785} 791}
786EXPORT_SYMBOL_GPL(dev_set_name); 792EXPORT_SYMBOL_GPL(dev_set_name);
diff --git a/fs/sysfs/bin.c b/fs/sysfs/bin.c
index 66f6e58a7e4b..f2c478c3424e 100644
--- a/fs/sysfs/bin.c
+++ b/fs/sysfs/bin.c
@@ -63,6 +63,9 @@ read(struct file *file, char __user *userbuf, size_t bytes, loff_t *off)
63 int count = min_t(size_t, bytes, PAGE_SIZE); 63 int count = min_t(size_t, bytes, PAGE_SIZE);
64 char *temp; 64 char *temp;
65 65
66 if (!bytes)
67 return 0;
68
66 if (size) { 69 if (size) {
67 if (offs > size) 70 if (offs > size)
68 return 0; 71 return 0;
@@ -131,6 +134,9 @@ static ssize_t write(struct file *file, const char __user *userbuf,
131 int count = min_t(size_t, bytes, PAGE_SIZE); 134 int count = min_t(size_t, bytes, PAGE_SIZE);
132 char *temp; 135 char *temp;
133 136
137 if (!bytes)
138 return 0;
139
134 if (size) { 140 if (size) {
135 if (offs > size) 141 if (offs > size)
136 return 0; 142 return 0;
diff --git a/include/linux/debugfs.h b/include/linux/debugfs.h
index 23936b16426b..0f5c33b0bd3e 100644
--- a/include/linux/debugfs.h
+++ b/include/linux/debugfs.h
@@ -162,6 +162,13 @@ static inline struct dentry *debugfs_create_x32(const char *name, mode_t mode,
162 return ERR_PTR(-ENODEV); 162 return ERR_PTR(-ENODEV);
163} 163}
164 164
165struct dentry *debugfs_create_size_t(const char *name, mode_t mode,
166 struct dentry *parent,
167 size_t *value)
168{
169 return ERR_PTR(-ENODEV);
170}
171
165static inline struct dentry *debugfs_create_bool(const char *name, mode_t mode, 172static inline struct dentry *debugfs_create_bool(const char *name, mode_t mode,
166 struct dentry *parent, 173 struct dentry *parent,
167 u32 *value) 174 u32 *value)
diff --git a/include/linux/klist.h b/include/linux/klist.h
index d5a27af9dba5..e91a4e59b771 100644
--- a/include/linux/klist.h
+++ b/include/linux/klist.h
@@ -22,7 +22,7 @@ struct klist {
22 struct list_head k_list; 22 struct list_head k_list;
23 void (*get)(struct klist_node *); 23 void (*get)(struct klist_node *);
24 void (*put)(struct klist_node *); 24 void (*put)(struct klist_node *);
25}; 25} __attribute__ ((aligned (4)));
26 26
27#define KLIST_INIT(_name, _get, _put) \ 27#define KLIST_INIT(_name, _get, _put) \
28 { .k_lock = __SPIN_LOCK_UNLOCKED(_name.k_lock), \ 28 { .k_lock = __SPIN_LOCK_UNLOCKED(_name.k_lock), \
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index d4dc222a74f3..491b8b1b6abf 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -366,11 +366,17 @@ static void do_pnp_device_entry(void *symval, unsigned long size,
366 366
367 for (i = 0; i < count; i++) { 367 for (i = 0; i < count; i++) {
368 const char *id = (char *)devs[i].id; 368 const char *id = (char *)devs[i].id;
369 char acpi_id[sizeof(devs[0].id)];
370 int j;
369 371
370 buf_printf(&mod->dev_table_buf, 372 buf_printf(&mod->dev_table_buf,
371 "MODULE_ALIAS(\"pnp:d%s*\");\n", id); 373 "MODULE_ALIAS(\"pnp:d%s*\");\n", id);
374
375 /* fix broken pnp bus lowercasing */
376 for (j = 0; j < sizeof(acpi_id); j++)
377 acpi_id[j] = toupper(id[j]);
372 buf_printf(&mod->dev_table_buf, 378 buf_printf(&mod->dev_table_buf,
373 "MODULE_ALIAS(\"acpi*:%s:*\");\n", id); 379 "MODULE_ALIAS(\"acpi*:%s:*\");\n", acpi_id);
374 } 380 }
375} 381}
376 382
@@ -416,10 +422,17 @@ static void do_pnp_card_entries(void *symval, unsigned long size,
416 422
417 /* add an individual alias for every device entry */ 423 /* add an individual alias for every device entry */
418 if (!dup) { 424 if (!dup) {
425 char acpi_id[sizeof(card->devs[0].id)];
426 int k;
427
419 buf_printf(&mod->dev_table_buf, 428 buf_printf(&mod->dev_table_buf,
420 "MODULE_ALIAS(\"pnp:d%s*\");\n", id); 429 "MODULE_ALIAS(\"pnp:d%s*\");\n", id);
430
431 /* fix broken pnp bus lowercasing */
432 for (k = 0; k < sizeof(acpi_id); k++)
433 acpi_id[k] = toupper(id[k]);
421 buf_printf(&mod->dev_table_buf, 434 buf_printf(&mod->dev_table_buf,
422 "MODULE_ALIAS(\"acpi*:%s:*\");\n", id); 435 "MODULE_ALIAS(\"acpi*:%s:*\");\n", acpi_id);
423 } 436 }
424 } 437 }
425 } 438 }