Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-cor…
Browse files Browse the repository at this point in the history
…e-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6:
  klist.c: bit 0 in pointer can't be used as flag
  debugfs: introduce stub for debugfs_create_size_t() when DEBUG_FS=n
  sysfs: fix problems with binary files
  PNP: fix broken pnp lowercasing for acpi module aliases
  driver core: Convert '/' to '!' in dev_set_name()
  • Loading branch information
Linus Torvalds committed Jan 26, 2009
2 parents 6aeea60 + c0e69a5 commit ed80386
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 3 deletions.
6 changes: 6 additions & 0 deletions drivers/base/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -777,10 +777,16 @@ static void device_remove_class_symlinks(struct device *dev)
int dev_set_name(struct device *dev, const char *fmt, ...)
{
va_list vargs;
char *s;

va_start(vargs, fmt);
vsnprintf(dev->bus_id, sizeof(dev->bus_id), fmt, vargs);
va_end(vargs);

/* ewww... some of these buggers have / in the name... */
while ((s = strchr(dev->bus_id, '/')))
*s = '!';

return 0;
}
EXPORT_SYMBOL_GPL(dev_set_name);
Expand Down
6 changes: 6 additions & 0 deletions fs/sysfs/bin.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ read(struct file *file, char __user *userbuf, size_t bytes, loff_t *off)
int count = min_t(size_t, bytes, PAGE_SIZE);
char *temp;

if (!bytes)
return 0;

if (size) {
if (offs > size)
return 0;
Expand Down Expand Up @@ -131,6 +134,9 @@ static ssize_t write(struct file *file, const char __user *userbuf,
int count = min_t(size_t, bytes, PAGE_SIZE);
char *temp;

if (!bytes)
return 0;

if (size) {
if (offs > size)
return 0;
Expand Down
7 changes: 7 additions & 0 deletions include/linux/debugfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,13 @@ static inline struct dentry *debugfs_create_x32(const char *name, mode_t mode,
return ERR_PTR(-ENODEV);
}

struct dentry *debugfs_create_size_t(const char *name, mode_t mode,
struct dentry *parent,
size_t *value)
{
return ERR_PTR(-ENODEV);
}

static inline struct dentry *debugfs_create_bool(const char *name, mode_t mode,
struct dentry *parent,
u32 *value)
Expand Down
2 changes: 1 addition & 1 deletion include/linux/klist.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ struct klist {
struct list_head k_list;
void (*get)(struct klist_node *);
void (*put)(struct klist_node *);
};
} __attribute__ ((aligned (4)));

#define KLIST_INIT(_name, _get, _put) \
{ .k_lock = __SPIN_LOCK_UNLOCKED(_name.k_lock), \
Expand Down
17 changes: 15 additions & 2 deletions scripts/mod/file2alias.c
Original file line number Diff line number Diff line change
Expand Up @@ -366,11 +366,17 @@ static void do_pnp_device_entry(void *symval, unsigned long size,

for (i = 0; i < count; i++) {
const char *id = (char *)devs[i].id;
char acpi_id[sizeof(devs[0].id)];
int j;

buf_printf(&mod->dev_table_buf,
"MODULE_ALIAS(\"pnp:d%s*\");\n", id);

/* fix broken pnp bus lowercasing */
for (j = 0; j < sizeof(acpi_id); j++)
acpi_id[j] = toupper(id[j]);
buf_printf(&mod->dev_table_buf,
"MODULE_ALIAS(\"acpi*:%s:*\");\n", id);
"MODULE_ALIAS(\"acpi*:%s:*\");\n", acpi_id);
}
}

Expand Down Expand Up @@ -416,10 +422,17 @@ static void do_pnp_card_entries(void *symval, unsigned long size,

/* add an individual alias for every device entry */
if (!dup) {
char acpi_id[sizeof(card->devs[0].id)];
int k;

buf_printf(&mod->dev_table_buf,
"MODULE_ALIAS(\"pnp:d%s*\");\n", id);

/* fix broken pnp bus lowercasing */
for (k = 0; k < sizeof(acpi_id); k++)
acpi_id[k] = toupper(id[k]);
buf_printf(&mod->dev_table_buf,
"MODULE_ALIAS(\"acpi*:%s:*\");\n", id);
"MODULE_ALIAS(\"acpi*:%s:*\");\n", acpi_id);
}
}
}
Expand Down

0 comments on commit ed80386

Please sign in to comment.