summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/device.h2
-rw-r--r--include/linux/kobject.h2
-rw-r--r--include/linux/module.h25
-rw-r--r--include/linux/moduleparam.h4
-rw-r--r--include/linux/sysfs.h2
5 files changed, 30 insertions, 5 deletions
diff --git a/include/linux/device.h b/include/linux/device.h
index 9bc07b556eea..bd05cdfb326e 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -400,7 +400,7 @@ extern void firmware_unregister(struct subsystem *);
/* debugging and troubleshooting/diagnostic helpers. */
#define dev_printk(level, dev, format, arg...) \
- printk(level "%s %s: " format , (dev)->driver->name , (dev)->bus_id , ## arg)
+ printk(level "%s %s: " format , (dev)->driver ? (dev)->driver->name : "" , (dev)->bus_id , ## arg)
#ifdef DEBUG
#define dev_dbg(dev, format, arg...) \
diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index f32f39b4cce6..6360d225884c 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -48,7 +48,7 @@ extern void kobject_cleanup(struct kobject *);
extern int kobject_add(struct kobject *);
extern void kobject_del(struct kobject *);
-extern void kobject_rename(struct kobject *, char *new_name);
+extern int kobject_rename(struct kobject *, char *new_name);
extern int kobject_register(struct kobject *);
extern void kobject_unregister(struct kobject *);
diff --git a/include/linux/module.h b/include/linux/module.h
index 0a86652fb1cb..9a3eb2f1f95d 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -16,6 +16,8 @@
#include <linux/kmod.h>
#include <linux/elf.h>
#include <linux/stringify.h>
+#include <linux/kobject.h>
+#include <linux/moduleparam.h>
#include <asm/local.h>
#include <asm/module.h>
@@ -207,6 +209,23 @@ enum module_state
MODULE_STATE_GOING,
};
+/* sysfs stuff */
+struct module_attribute
+{
+ struct attribute attr;
+ struct kernel_param *param;
+};
+
+struct module_kobject
+{
+ /* Everyone should have one of these. */
+ struct kobject kobj;
+
+ /* We always have refcnt, we may have others from module_param(). */
+ unsigned int num_attributes;
+ struct module_attribute attr[0];
+};
+
struct module
{
enum module_state state;
@@ -217,6 +236,9 @@ struct module
/* Unique handle for this module */
char name[MODULE_NAME_LEN];
+ /* Sysfs stuff. */
+ struct module_kobject *mkobj;
+
/* Exported symbols */
const struct kernel_symbol *syms;
unsigned int num_syms;
@@ -267,6 +289,9 @@ struct module
/* Destruction function. */
void (*exit)(void);
+
+ /* Fake kernel param for refcnt. */
+ struct kernel_param refcnt_param;
#endif
#ifdef CONFIG_KALLSYMS
diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h
index e9d6a16d3fef..f63de16cdf54 100644
--- a/include/linux/moduleparam.h
+++ b/include/linux/moduleparam.h
@@ -50,7 +50,7 @@ struct kparam_array
not there, read bits mean it's readable, write bits mean it's
writable. */
#define __module_param_call(prefix, name, set, get, arg, perm) \
- static char __param_str_##name[] __initdata = prefix #name; \
+ static char __param_str_##name[] = prefix #name; \
static struct kernel_param const __param_##name \
__attribute_used__ \
__attribute__ ((unused,__section__ ("__param"),aligned(sizeof(void *)))) \
@@ -71,7 +71,7 @@ struct kparam_array
/* Actually copy string: maxlen param is usually sizeof(string). */
#define module_param_string(name, string, len, perm) \
- static struct kparam_string __param_string_##name __initdata \
+ static struct kparam_string __param_string_##name \
= { len, string }; \
module_param_call(name, param_set_copystring, param_get_charp, \
&__param_string_##name, perm)
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
index de2083939b74..31f1c8b4428d 100644
--- a/include/linux/sysfs.h
+++ b/include/linux/sysfs.h
@@ -44,7 +44,7 @@ sysfs_create_dir(struct kobject *);
extern void
sysfs_remove_dir(struct kobject *);
-extern void
+extern int
sysfs_rename_dir(struct kobject *, const char *new_name);
extern int