|
@@ -15,6 +15,7 @@
|
|
#include <linux/export.h>
|
|
#include <linux/export.h>
|
|
#include <linux/i2c.h>
|
|
#include <linux/i2c.h>
|
|
#include <linux/kernel.h>
|
|
#include <linux/kernel.h>
|
|
|
|
+#include <linux/property.h>
|
|
#include <linux/rwsem.h>
|
|
#include <linux/rwsem.h>
|
|
#include <linux/slab.h>
|
|
#include <linux/slab.h>
|
|
|
|
|
|
@@ -55,6 +56,7 @@ EXPORT_SYMBOL_GPL(__i2c_first_dynamic_bus_num);
|
|
*
|
|
*
|
|
* The board info passed can safely be __initdata, but be careful of embedded
|
|
* The board info passed can safely be __initdata, but be careful of embedded
|
|
* pointers (for platform_data, functions, etc) since that won't be copied.
|
|
* pointers (for platform_data, functions, etc) since that won't be copied.
|
|
|
|
+ * Device properties are deep-copied though.
|
|
*/
|
|
*/
|
|
int i2c_register_board_info(int busnum, struct i2c_board_info const *info, unsigned len)
|
|
int i2c_register_board_info(int busnum, struct i2c_board_info const *info, unsigned len)
|
|
{
|
|
{
|
|
@@ -78,6 +80,16 @@ int i2c_register_board_info(int busnum, struct i2c_board_info const *info, unsig
|
|
|
|
|
|
devinfo->busnum = busnum;
|
|
devinfo->busnum = busnum;
|
|
devinfo->board_info = *info;
|
|
devinfo->board_info = *info;
|
|
|
|
+
|
|
|
|
+ if (info->properties) {
|
|
|
|
+ devinfo->board_info.properties =
|
|
|
|
+ property_entries_dup(info->properties);
|
|
|
|
+ if (IS_ERR(devinfo->board_info.properties)) {
|
|
|
|
+ status = PTR_ERR(devinfo->board_info.properties);
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
list_add_tail(&devinfo->list, &__i2c_board_list);
|
|
list_add_tail(&devinfo->list, &__i2c_board_list);
|
|
}
|
|
}
|
|
|
|
|