serial: fix NULL pointer dereference
[safe/jmp/linux-2.6] / include / linux / mod_devicetable.h
index 97b91d1..f58e9d8 100644 (file)
@@ -399,6 +399,17 @@ struct i2c_device_id {
                        __attribute__((aligned(sizeof(kernel_ulong_t))));
 };
 
+/* spi */
+
+#define SPI_NAME_SIZE  32
+#define SPI_MODULE_PREFIX "spi:"
+
+struct spi_device_id {
+       char name[SPI_NAME_SIZE];
+       kernel_ulong_t driver_data      /* Data private to the driver */
+                       __attribute__((aligned(sizeof(kernel_ulong_t))));
+};
+
 /* dmi */
 enum dmi_field {
        DMI_NONE,
@@ -443,8 +454,24 @@ struct dmi_system_id {
        struct dmi_strmatch matches[4];
        void *driver_data;
 };
+/*
+ * struct dmi_device_id appears during expansion of
+ * "MODULE_DEVICE_TABLE(dmi, x)". Compiler doesn't look inside it
+ * but this is enough for gcc 3.4.6 to error out:
+ *     error: storage size of '__mod_dmi_device_table' isn't known
+ */
+#define dmi_device_id dmi_system_id
 #endif
 
 #define DMI_MATCH(a, b)        { a, b }
 
+#define PLATFORM_NAME_SIZE     20
+#define PLATFORM_MODULE_PREFIX "platform:"
+
+struct platform_device_id {
+       char name[PLATFORM_NAME_SIZE];
+       kernel_ulong_t driver_data
+                       __attribute__((aligned(sizeof(kernel_ulong_t))));
+};
+
 #endif /* LINUX_MOD_DEVICETABLE_H */