diff options
Diffstat (limited to 'drivers/of')
-rw-r--r-- | drivers/of/device.c | 6 | ||||
-rw-r--r-- | drivers/of/kexec.c | 10 | ||||
-rw-r--r-- | drivers/of/overlay.c | 4 | ||||
-rw-r--r-- | drivers/of/platform.c | 5 | ||||
-rw-r--r-- | drivers/of/property.c | 4 | ||||
-rw-r--r-- | drivers/of/unittest-data/Makefile | 66 | ||||
-rw-r--r-- | drivers/of/unittest-data/overlay.dtso (renamed from drivers/of/unittest-data/overlay.dts) | 0 | ||||
-rw-r--r-- | drivers/of/unittest-data/overlay_0.dtso (renamed from drivers/of/unittest-data/overlay_0.dts) | 0 | ||||
-rw-r--r-- | drivers/of/unittest-data/overlay_1.dtso (renamed from drivers/of/unittest-data/overlay_1.dts) | 0 | ||||
-rw-r--r-- | drivers/of/unittest-data/overlay_10.dtso (renamed from drivers/of/unittest-data/overlay_10.dts) | 0 | ||||
-rw-r--r-- | drivers/of/unittest-data/overlay_11.dtso (renamed from drivers/of/unittest-data/overlay_11.dts) | 0 | ||||
-rw-r--r-- | drivers/of/unittest-data/overlay_12.dtso (renamed from drivers/of/unittest-data/overlay_12.dts) | 0 | ||||
-rw-r--r-- | drivers/of/unittest-data/overlay_13.dtso (renamed from drivers/of/unittest-data/overlay_13.dts) | 0 | ||||
-rw-r--r-- | drivers/of/unittest-data/overlay_15.dtso (renamed from drivers/of/unittest-data/overlay_15.dts) | 0 | ||||
-rw-r--r-- | drivers/of/unittest-data/overlay_16.dtso (renamed from drivers/of/unittest-data/overlay_16.dts) | 0 | ||||
-rw-r--r-- | drivers/of/unittest-data/overlay_17.dtso (renamed from drivers/of/unittest-data/overlay_17.dts) | 0 | ||||
-rw-r--r-- | drivers/of/unittest-data/overlay_18.dtso (renamed from drivers/of/unittest-data/overlay_18.dts) | 0 | ||||
-rw-r--r-- | drivers/of/unittest-data/overlay_19.dtso (renamed from drivers/of/unittest-data/overlay_19.dts) | 0 | ||||
-rw-r--r-- | drivers/of/unittest-data/overlay_2.dtso (renamed from drivers/of/unittest-data/overlay_2.dts) | 0 | ||||
-rw-r--r-- | drivers/of/unittest-data/overlay_20.dtso (renamed from drivers/of/unittest-data/overlay_20.dts) | 0 | ||||
-rw-r--r-- | drivers/of/unittest-data/overlay_3.dtso (renamed from drivers/of/unittest-data/overlay_3.dts) | 0 | ||||
-rw-r--r-- | drivers/of/unittest-data/overlay_4.dtso (renamed from drivers/of/unittest-data/overlay_4.dts) | 0 | ||||
-rw-r--r-- | drivers/of/unittest-data/overlay_5.dtso (renamed from drivers/of/unittest-data/overlay_5.dts) | 0 | ||||
-rw-r--r-- | drivers/of/unittest-data/overlay_6.dtso (renamed from drivers/of/unittest-data/overlay_6.dts) | 0 | ||||
-rw-r--r-- | drivers/of/unittest-data/overlay_7.dtso (renamed from drivers/of/unittest-data/overlay_7.dts) | 0 | ||||
-rw-r--r-- | drivers/of/unittest-data/overlay_8.dtso (renamed from drivers/of/unittest-data/overlay_8.dts) | 0 | ||||
-rw-r--r-- | drivers/of/unittest-data/overlay_9.dtso (renamed from drivers/of/unittest-data/overlay_9.dts) | 0 | ||||
-rw-r--r-- | drivers/of/unittest-data/overlay_bad_add_dup_node.dtso (renamed from drivers/of/unittest-data/overlay_bad_add_dup_node.dts) | 0 | ||||
-rw-r--r-- | drivers/of/unittest-data/overlay_bad_add_dup_prop.dtso (renamed from drivers/of/unittest-data/overlay_bad_add_dup_prop.dts) | 0 | ||||
-rw-r--r-- | drivers/of/unittest-data/overlay_bad_phandle.dtso (renamed from drivers/of/unittest-data/overlay_bad_phandle.dts) | 0 | ||||
-rw-r--r-- | drivers/of/unittest-data/overlay_bad_symbol.dtso (renamed from drivers/of/unittest-data/overlay_bad_symbol.dts) | 0 | ||||
-rw-r--r-- | drivers/of/unittest-data/overlay_base.dtso (renamed from drivers/of/unittest-data/overlay_base.dts) | 0 | ||||
-rw-r--r-- | drivers/of/unittest-data/overlay_gpio_01.dtso (renamed from drivers/of/unittest-data/overlay_gpio_01.dts) | 0 | ||||
-rw-r--r-- | drivers/of/unittest-data/overlay_gpio_02a.dtso (renamed from drivers/of/unittest-data/overlay_gpio_02a.dts) | 0 | ||||
-rw-r--r-- | drivers/of/unittest-data/overlay_gpio_02b.dtso (renamed from drivers/of/unittest-data/overlay_gpio_02b.dts) | 0 | ||||
-rw-r--r-- | drivers/of/unittest-data/overlay_gpio_03.dtso (renamed from drivers/of/unittest-data/overlay_gpio_03.dts) | 0 | ||||
-rw-r--r-- | drivers/of/unittest-data/overlay_gpio_04a.dtso (renamed from drivers/of/unittest-data/overlay_gpio_04a.dts) | 0 | ||||
-rw-r--r-- | drivers/of/unittest-data/overlay_gpio_04b.dtso (renamed from drivers/of/unittest-data/overlay_gpio_04b.dts) | 0 | ||||
-rw-r--r-- | drivers/of/unittest-data/testcases.dtso (renamed from drivers/of/unittest-data/testcases.dts) | 0 | ||||
-rw-r--r-- | drivers/of/unittest.c | 58 |
40 files changed, 76 insertions, 77 deletions
diff --git a/drivers/of/device.c b/drivers/of/device.c index 8cefe5a7d04e..c674a13c3055 100644 --- a/drivers/of/device.c +++ b/drivers/of/device.c @@ -332,10 +332,10 @@ EXPORT_SYMBOL_GPL(of_device_modalias); /** * of_device_uevent - Display OF related uevent information - * @dev: Device to apply DMA configuration - * @env: Kernel object's userspace event reference + * @dev: Device to display the uevent information for + * @env: Kernel object's userspace event reference to fill up */ -void of_device_uevent(struct device *dev, struct kobj_uevent_env *env) +void of_device_uevent(const struct device *dev, struct kobj_uevent_env *env) { const char *compat, *type; struct alias_prop *app; diff --git a/drivers/of/kexec.c b/drivers/of/kexec.c index e6c01db393f9..f26d2ba8a371 100644 --- a/drivers/of/kexec.c +++ b/drivers/of/kexec.c @@ -281,7 +281,7 @@ void *of_kexec_alloc_and_setup_fdt(const struct kimage *image, const char *cmdline, size_t extra_fdt_size) { void *fdt; - int ret, chosen_node; + int ret, chosen_node, len; const void *prop; size_t fdt_size; @@ -324,19 +324,19 @@ void *of_kexec_alloc_and_setup_fdt(const struct kimage *image, goto out; /* Did we boot using an initrd? */ - prop = fdt_getprop(fdt, chosen_node, "linux,initrd-start", NULL); + prop = fdt_getprop(fdt, chosen_node, "linux,initrd-start", &len); if (prop) { u64 tmp_start, tmp_end, tmp_size; - tmp_start = fdt64_to_cpu(*((const fdt64_t *) prop)); + tmp_start = of_read_number(prop, len / 4); - prop = fdt_getprop(fdt, chosen_node, "linux,initrd-end", NULL); + prop = fdt_getprop(fdt, chosen_node, "linux,initrd-end", &len); if (!prop) { ret = -EINVAL; goto out; } - tmp_end = fdt64_to_cpu(*((const fdt64_t *) prop)); + tmp_end = of_read_number(prop, len / 4); /* * kexec reserves exact initrd size, while firmware may diff --git a/drivers/of/overlay.c b/drivers/of/overlay.c index bd8ff4df723d..ed4e6c144a68 100644 --- a/drivers/of/overlay.c +++ b/drivers/of/overlay.c @@ -545,7 +545,7 @@ static int find_dup_cset_node_entry(struct overlay_changeset *ovcs, fn_1 = kasprintf(GFP_KERNEL, "%pOF", ce_1->np); fn_2 = kasprintf(GFP_KERNEL, "%pOF", ce_2->np); - node_path_match = !strcmp(fn_1, fn_2); + node_path_match = !fn_1 || !fn_2 || !strcmp(fn_1, fn_2); kfree(fn_1); kfree(fn_2); if (node_path_match) { @@ -580,7 +580,7 @@ static int find_dup_cset_prop(struct overlay_changeset *ovcs, fn_1 = kasprintf(GFP_KERNEL, "%pOF", ce_1->np); fn_2 = kasprintf(GFP_KERNEL, "%pOF", ce_2->np); - node_path_match = !strcmp(fn_1, fn_2); + node_path_match = !fn_1 || !fn_2 || !strcmp(fn_1, fn_2); kfree(fn_1); kfree(fn_2); if (node_path_match && diff --git a/drivers/of/platform.c b/drivers/of/platform.c index 3507095a69f6..81c8c227ab6b 100644 --- a/drivers/of/platform.c +++ b/drivers/of/platform.c @@ -115,15 +115,14 @@ struct platform_device *of_device_alloc(struct device_node *np, { struct platform_device *dev; int rc, i, num_reg = 0; - struct resource *res, temp_res; + struct resource *res; dev = platform_device_alloc("", PLATFORM_DEVID_NONE); if (!dev) return NULL; /* count the io resources */ - while (of_address_to_resource(np, num_reg, &temp_res) == 0) - num_reg++; + num_reg = of_address_count(np); /* Populate the resource table */ if (num_reg) { diff --git a/drivers/of/property.c b/drivers/of/property.c index 967f79b59016..134cfc980b70 100644 --- a/drivers/of/property.c +++ b/drivers/of/property.c @@ -993,8 +993,10 @@ of_fwnode_get_reference_args(const struct fwnode_handle *fwnode, nargs, index, &of_args); if (ret < 0) return ret; - if (!args) + if (!args) { + of_node_put(of_args.np); return 0; + } args->nargs = of_args.args_count; args->fwnode = of_fwnode_handle(of_args.np); diff --git a/drivers/of/unittest-data/Makefile b/drivers/of/unittest-data/Makefile index d072f3ba3971..ea5f4da68e23 100644 --- a/drivers/of/unittest-data/Makefile +++ b/drivers/of/unittest-data/Makefile @@ -1,38 +1,38 @@ # SPDX-License-Identifier: GPL-2.0 -obj-y += testcases.dtb.o +obj-y += testcases.dtbo.o -obj-$(CONFIG_OF_OVERLAY) += overlay.dtb.o \ - overlay_0.dtb.o \ - overlay_1.dtb.o \ - overlay_2.dtb.o \ - overlay_3.dtb.o \ - overlay_4.dtb.o \ - overlay_5.dtb.o \ - overlay_6.dtb.o \ - overlay_7.dtb.o \ - overlay_8.dtb.o \ - overlay_9.dtb.o \ - overlay_10.dtb.o \ - overlay_11.dtb.o \ - overlay_12.dtb.o \ - overlay_13.dtb.o \ - overlay_15.dtb.o \ - overlay_16.dtb.o \ - overlay_17.dtb.o \ - overlay_18.dtb.o \ - overlay_19.dtb.o \ - overlay_20.dtb.o \ - overlay_bad_add_dup_node.dtb.o \ - overlay_bad_add_dup_prop.dtb.o \ - overlay_bad_phandle.dtb.o \ - overlay_bad_symbol.dtb.o \ - overlay_base.dtb.o \ - overlay_gpio_01.dtb.o \ - overlay_gpio_02a.dtb.o \ - overlay_gpio_02b.dtb.o \ - overlay_gpio_03.dtb.o \ - overlay_gpio_04a.dtb.o \ - overlay_gpio_04b.dtb.o +obj-$(CONFIG_OF_OVERLAY) += overlay.dtbo.o \ + overlay_0.dtbo.o \ + overlay_1.dtbo.o \ + overlay_2.dtbo.o \ + overlay_3.dtbo.o \ + overlay_4.dtbo.o \ + overlay_5.dtbo.o \ + overlay_6.dtbo.o \ + overlay_7.dtbo.o \ + overlay_8.dtbo.o \ + overlay_9.dtbo.o \ + overlay_10.dtbo.o \ + overlay_11.dtbo.o \ + overlay_12.dtbo.o \ + overlay_13.dtbo.o \ + overlay_15.dtbo.o \ + overlay_16.dtbo.o \ + overlay_17.dtbo.o \ + overlay_18.dtbo.o \ + overlay_19.dtbo.o \ + overlay_20.dtbo.o \ + overlay_bad_add_dup_node.dtbo.o \ + overlay_bad_add_dup_prop.dtbo.o \ + overlay_bad_phandle.dtbo.o \ + overlay_bad_symbol.dtbo.o \ + overlay_base.dtbo.o \ + overlay_gpio_01.dtbo.o \ + overlay_gpio_02a.dtbo.o \ + overlay_gpio_02b.dtbo.o \ + overlay_gpio_03.dtbo.o \ + overlay_gpio_04a.dtbo.o \ + overlay_gpio_04b.dtbo.o # enable creation of __symbols__ node DTC_FLAGS_overlay += -@ diff --git a/drivers/of/unittest-data/overlay.dts b/drivers/of/unittest-data/overlay.dtso index 3bbc59e922fe..3bbc59e922fe 100644 --- a/drivers/of/unittest-data/overlay.dts +++ b/drivers/of/unittest-data/overlay.dtso diff --git a/drivers/of/unittest-data/overlay_0.dts b/drivers/of/unittest-data/overlay_0.dtso index ac0f9e0fe65f..ac0f9e0fe65f 100644 --- a/drivers/of/unittest-data/overlay_0.dts +++ b/drivers/of/unittest-data/overlay_0.dtso diff --git a/drivers/of/unittest-data/overlay_1.dts b/drivers/of/unittest-data/overlay_1.dtso index e92a626e2948..e92a626e2948 100644 --- a/drivers/of/unittest-data/overlay_1.dts +++ b/drivers/of/unittest-data/overlay_1.dtso diff --git a/drivers/of/unittest-data/overlay_10.dts b/drivers/of/unittest-data/overlay_10.dtso index 73993bf23bf8..73993bf23bf8 100644 --- a/drivers/of/unittest-data/overlay_10.dts +++ b/drivers/of/unittest-data/overlay_10.dtso diff --git a/drivers/of/unittest-data/overlay_11.dts b/drivers/of/unittest-data/overlay_11.dtso index 9a79b253a809..9a79b253a809 100644 --- a/drivers/of/unittest-data/overlay_11.dts +++ b/drivers/of/unittest-data/overlay_11.dtso diff --git a/drivers/of/unittest-data/overlay_12.dts b/drivers/of/unittest-data/overlay_12.dtso index ca3441e2cbec..ca3441e2cbec 100644 --- a/drivers/of/unittest-data/overlay_12.dts +++ b/drivers/of/unittest-data/overlay_12.dtso diff --git a/drivers/of/unittest-data/overlay_13.dts b/drivers/of/unittest-data/overlay_13.dtso index 3c30dec63894..3c30dec63894 100644 --- a/drivers/of/unittest-data/overlay_13.dts +++ b/drivers/of/unittest-data/overlay_13.dtso diff --git a/drivers/of/unittest-data/overlay_15.dts b/drivers/of/unittest-data/overlay_15.dtso index 5728490474f6..5728490474f6 100644 --- a/drivers/of/unittest-data/overlay_15.dts +++ b/drivers/of/unittest-data/overlay_15.dtso diff --git a/drivers/of/unittest-data/overlay_16.dts b/drivers/of/unittest-data/overlay_16.dtso index 80a46dc02581..80a46dc02581 100644 --- a/drivers/of/unittest-data/overlay_16.dts +++ b/drivers/of/unittest-data/overlay_16.dtso diff --git a/drivers/of/unittest-data/overlay_17.dts b/drivers/of/unittest-data/overlay_17.dtso index 5b8a2209177f..5b8a2209177f 100644 --- a/drivers/of/unittest-data/overlay_17.dts +++ b/drivers/of/unittest-data/overlay_17.dtso diff --git a/drivers/of/unittest-data/overlay_18.dts b/drivers/of/unittest-data/overlay_18.dtso index dcddd5f6d301..dcddd5f6d301 100644 --- a/drivers/of/unittest-data/overlay_18.dts +++ b/drivers/of/unittest-data/overlay_18.dtso diff --git a/drivers/of/unittest-data/overlay_19.dts b/drivers/of/unittest-data/overlay_19.dtso index 32b3ba0b66a3..32b3ba0b66a3 100644 --- a/drivers/of/unittest-data/overlay_19.dts +++ b/drivers/of/unittest-data/overlay_19.dtso diff --git a/drivers/of/unittest-data/overlay_2.dts b/drivers/of/unittest-data/overlay_2.dtso index db8684ba89d9..db8684ba89d9 100644 --- a/drivers/of/unittest-data/overlay_2.dts +++ b/drivers/of/unittest-data/overlay_2.dtso diff --git a/drivers/of/unittest-data/overlay_20.dts b/drivers/of/unittest-data/overlay_20.dtso index d4a4f2f32ec7..d4a4f2f32ec7 100644 --- a/drivers/of/unittest-data/overlay_20.dts +++ b/drivers/of/unittest-data/overlay_20.dtso diff --git a/drivers/of/unittest-data/overlay_3.dts b/drivers/of/unittest-data/overlay_3.dtso index 40f289e7c237..40f289e7c237 100644 --- a/drivers/of/unittest-data/overlay_3.dts +++ b/drivers/of/unittest-data/overlay_3.dtso diff --git a/drivers/of/unittest-data/overlay_4.dts b/drivers/of/unittest-data/overlay_4.dtso index a8a77ddf9abe..a8a77ddf9abe 100644 --- a/drivers/of/unittest-data/overlay_4.dts +++ b/drivers/of/unittest-data/overlay_4.dtso diff --git a/drivers/of/unittest-data/overlay_5.dts b/drivers/of/unittest-data/overlay_5.dtso index 706f5f1b737c..706f5f1b737c 100644 --- a/drivers/of/unittest-data/overlay_5.dts +++ b/drivers/of/unittest-data/overlay_5.dtso diff --git a/drivers/of/unittest-data/overlay_6.dts b/drivers/of/unittest-data/overlay_6.dtso index 21a7fa4ca45e..21a7fa4ca45e 100644 --- a/drivers/of/unittest-data/overlay_6.dts +++ b/drivers/of/unittest-data/overlay_6.dtso diff --git a/drivers/of/unittest-data/overlay_7.dts b/drivers/of/unittest-data/overlay_7.dtso index 58ba1bb51b50..58ba1bb51b50 100644 --- a/drivers/of/unittest-data/overlay_7.dts +++ b/drivers/of/unittest-data/overlay_7.dtso diff --git a/drivers/of/unittest-data/overlay_8.dts b/drivers/of/unittest-data/overlay_8.dtso index e9718d118e38..e9718d118e38 100644 --- a/drivers/of/unittest-data/overlay_8.dts +++ b/drivers/of/unittest-data/overlay_8.dtso diff --git a/drivers/of/unittest-data/overlay_9.dts b/drivers/of/unittest-data/overlay_9.dtso index b35e23edae50..b35e23edae50 100644 --- a/drivers/of/unittest-data/overlay_9.dts +++ b/drivers/of/unittest-data/overlay_9.dtso diff --git a/drivers/of/unittest-data/overlay_bad_add_dup_node.dts b/drivers/of/unittest-data/overlay_bad_add_dup_node.dtso index 145dfc3b1024..145dfc3b1024 100644 --- a/drivers/of/unittest-data/overlay_bad_add_dup_node.dts +++ b/drivers/of/unittest-data/overlay_bad_add_dup_node.dtso diff --git a/drivers/of/unittest-data/overlay_bad_add_dup_prop.dts b/drivers/of/unittest-data/overlay_bad_add_dup_prop.dtso index 6327d1ffb963..6327d1ffb963 100644 --- a/drivers/of/unittest-data/overlay_bad_add_dup_prop.dts +++ b/drivers/of/unittest-data/overlay_bad_add_dup_prop.dtso diff --git a/drivers/of/unittest-data/overlay_bad_phandle.dts b/drivers/of/unittest-data/overlay_bad_phandle.dtso index 83b797360318..83b797360318 100644 --- a/drivers/of/unittest-data/overlay_bad_phandle.dts +++ b/drivers/of/unittest-data/overlay_bad_phandle.dtso diff --git a/drivers/of/unittest-data/overlay_bad_symbol.dts b/drivers/of/unittest-data/overlay_bad_symbol.dtso index 98c6d1de144a..98c6d1de144a 100644 --- a/drivers/of/unittest-data/overlay_bad_symbol.dts +++ b/drivers/of/unittest-data/overlay_bad_symbol.dtso diff --git a/drivers/of/unittest-data/overlay_base.dts b/drivers/of/unittest-data/overlay_base.dtso index ab9014589c5d..ab9014589c5d 100644 --- a/drivers/of/unittest-data/overlay_base.dts +++ b/drivers/of/unittest-data/overlay_base.dtso diff --git a/drivers/of/unittest-data/overlay_gpio_01.dts b/drivers/of/unittest-data/overlay_gpio_01.dtso index 699ff104ae10..699ff104ae10 100644 --- a/drivers/of/unittest-data/overlay_gpio_01.dts +++ b/drivers/of/unittest-data/overlay_gpio_01.dtso diff --git a/drivers/of/unittest-data/overlay_gpio_02a.dts b/drivers/of/unittest-data/overlay_gpio_02a.dtso index ec59aff6ed47..ec59aff6ed47 100644 --- a/drivers/of/unittest-data/overlay_gpio_02a.dts +++ b/drivers/of/unittest-data/overlay_gpio_02a.dtso diff --git a/drivers/of/unittest-data/overlay_gpio_02b.dts b/drivers/of/unittest-data/overlay_gpio_02b.dtso index 43ce111d41ce..43ce111d41ce 100644 --- a/drivers/of/unittest-data/overlay_gpio_02b.dts +++ b/drivers/of/unittest-data/overlay_gpio_02b.dtso diff --git a/drivers/of/unittest-data/overlay_gpio_03.dts b/drivers/of/unittest-data/overlay_gpio_03.dtso index 6e0312340a1b..6e0312340a1b 100644 --- a/drivers/of/unittest-data/overlay_gpio_03.dts +++ b/drivers/of/unittest-data/overlay_gpio_03.dtso diff --git a/drivers/of/unittest-data/overlay_gpio_04a.dts b/drivers/of/unittest-data/overlay_gpio_04a.dtso index 7b1e04ebfa7a..7b1e04ebfa7a 100644 --- a/drivers/of/unittest-data/overlay_gpio_04a.dts +++ b/drivers/of/unittest-data/overlay_gpio_04a.dtso diff --git a/drivers/of/unittest-data/overlay_gpio_04b.dts b/drivers/of/unittest-data/overlay_gpio_04b.dtso index a14e95c6699a..a14e95c6699a 100644 --- a/drivers/of/unittest-data/overlay_gpio_04b.dts +++ b/drivers/of/unittest-data/overlay_gpio_04b.dtso diff --git a/drivers/of/unittest-data/testcases.dts b/drivers/of/unittest-data/testcases.dtso index 61cdd3d5fccb..61cdd3d5fccb 100644 --- a/drivers/of/unittest-data/testcases.dts +++ b/drivers/of/unittest-data/testcases.dtso diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c index b89ab5d9fea5..bc0f1e50a4be 100644 --- a/drivers/of/unittest.c +++ b/drivers/of/unittest.c @@ -1423,12 +1423,12 @@ static int __init unittest_data_add(void) void *unittest_data_align; struct device_node *unittest_data_node = NULL, *np; /* - * __dtb_testcases_begin[] and __dtb_testcases_end[] are magically - * created by cmd_dt_S_dtb in scripts/Makefile.lib + * __dtbo_testcases_begin[] and __dtbo_testcases_end[] are magically + * created by cmd_dt_S_dtbo in scripts/Makefile.lib */ - extern uint8_t __dtb_testcases_begin[]; - extern uint8_t __dtb_testcases_end[]; - const int size = __dtb_testcases_end - __dtb_testcases_begin; + extern uint8_t __dtbo_testcases_begin[]; + extern uint8_t __dtbo_testcases_end[]; + const int size = __dtbo_testcases_end - __dtbo_testcases_begin; int rc; void *ret; @@ -1443,7 +1443,7 @@ static int __init unittest_data_add(void) return -ENOMEM; unittest_data_align = PTR_ALIGN(unittest_data, FDT_ALIGN_SIZE); - memcpy(unittest_data_align, __dtb_testcases_begin, size); + memcpy(unittest_data_align, __dtbo_testcases_begin, size); ret = of_fdt_unflatten_tree(unittest_data_align, NULL, &unittest_data_node); if (!ret) { @@ -2508,8 +2508,7 @@ static struct platform_driver unittest_i2c_bus_driver = { }, }; -static int unittest_i2c_dev_probe(struct i2c_client *client, - const struct i2c_device_id *id) +static int unittest_i2c_dev_probe(struct i2c_client *client) { struct device *dev = &client->dev; struct device_node *np = client->dev.of_node; @@ -2541,7 +2540,7 @@ static struct i2c_driver unittest_i2c_dev_driver = { .driver = { .name = "unittest-i2c-dev", }, - .probe = unittest_i2c_dev_probe, + .probe_new = unittest_i2c_dev_probe, .remove = unittest_i2c_dev_remove, .id_table = unittest_i2c_dev_id, }; @@ -2553,8 +2552,7 @@ static int unittest_i2c_mux_select_chan(struct i2c_mux_core *muxc, u32 chan) return 0; } -static int unittest_i2c_mux_probe(struct i2c_client *client, - const struct i2c_device_id *id) +static int unittest_i2c_mux_probe(struct i2c_client *client) { int i, nchans; struct device *dev = &client->dev; @@ -2619,7 +2617,7 @@ static struct i2c_driver unittest_i2c_mux_driver = { .driver = { .name = "unittest-i2c-mux", }, - .probe = unittest_i2c_mux_probe, + .probe_new = unittest_i2c_mux_probe, .remove = unittest_i2c_mux_remove, .id_table = unittest_i2c_mux_id, }; @@ -3003,24 +3001,24 @@ static inline void __init of_unittest_overlay(void) { } #ifdef CONFIG_OF_OVERLAY /* - * __dtb_ot_begin[] and __dtb_ot_end[] are created by cmd_dt_S_dtb - * in scripts/Makefile.lib + * __dtbo_##overlay_name##_begin[] and __dtbo_##overlay_name##_end[] are + * created by cmd_dt_S_dtbo in scripts/Makefile.lib */ -#define OVERLAY_INFO_EXTERN(name) \ - extern uint8_t __dtb_##name##_begin[]; \ - extern uint8_t __dtb_##name##_end[] +#define OVERLAY_INFO_EXTERN(overlay_name) \ + extern uint8_t __dtbo_##overlay_name##_begin[]; \ + extern uint8_t __dtbo_##overlay_name##_end[] -#define OVERLAY_INFO(overlay_name, expected) \ -{ .dtb_begin = __dtb_##overlay_name##_begin, \ - .dtb_end = __dtb_##overlay_name##_end, \ - .expected_result = expected, \ - .name = #overlay_name, \ +#define OVERLAY_INFO(overlay_name, expected) \ +{ .dtbo_begin = __dtbo_##overlay_name##_begin, \ + .dtbo_end = __dtbo_##overlay_name##_end, \ + .expected_result = expected, \ + .name = #overlay_name, \ } struct overlay_info { - uint8_t *dtb_begin; - uint8_t *dtb_end; + uint8_t *dtbo_begin; + uint8_t *dtbo_end; int expected_result; int ovcs_id; char *name; @@ -3094,7 +3092,7 @@ static struct overlay_info overlays[] = { OVERLAY_INFO(overlay_bad_phandle, -EINVAL), OVERLAY_INFO(overlay_bad_symbol, -EINVAL), /* end marker */ - {.dtb_begin = NULL, .dtb_end = NULL, .expected_result = 0, .name = NULL} + {.dtbo_begin = NULL, .dtbo_end = NULL, .expected_result = 0, .name = NULL} }; static struct device_node *overlay_base_root; @@ -3151,13 +3149,13 @@ void __init unittest_unflatten_overlay_base(void) return; } - data_size = info->dtb_end - info->dtb_begin; + data_size = info->dtbo_end - info->dtbo_begin; if (!data_size) { pr_err("No dtb 'overlay_base' to attach\n"); return; } - size = fdt_totalsize(info->dtb_begin); + size = fdt_totalsize(info->dtbo_begin); if (size != data_size) { pr_err("dtb 'overlay_base' header totalsize != actual size"); return; @@ -3169,7 +3167,7 @@ void __init unittest_unflatten_overlay_base(void) return; } - memcpy(new_fdt, info->dtb_begin, size); + memcpy(new_fdt, info->dtbo_begin, size); __unflatten_device_tree(new_fdt, NULL, &overlay_base_root, dt_alloc_memory, true); @@ -3204,11 +3202,11 @@ static int __init overlay_data_apply(const char *overlay_name, int *ovcs_id) return 0; } - size = info->dtb_end - info->dtb_begin; + size = info->dtbo_end - info->dtbo_begin; if (!size) pr_err("no overlay data for %s\n", overlay_name); - ret = of_overlay_fdt_apply(info->dtb_begin, size, &info->ovcs_id); + ret = of_overlay_fdt_apply(info->dtbo_begin, size, &info->ovcs_id); if (ovcs_id) *ovcs_id = info->ovcs_id; if (ret < 0) |