From: Bin Yang Date: Wed, 22 Feb 2017 06:05:10 +0000 (+0800) Subject: drm/rockchip: cdn-dp: modify switchdev name to "cdn-dp" X-Git-Tag: firefly_0821_release~565 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=3bcded966b98a9a4e8aa289308e9826fb6788f89;p=firefly-linux-kernel-4.4.55.git drm/rockchip: cdn-dp: modify switchdev name to "cdn-dp" If DP and HDMI are enabled at the same board, they will be register switchdev with the same name in the same directory. This would cause register switchdev fail. Resulting in the following error: [ 0.882415] [] sysfs_warn_dup+0x60/0x7c [ 0.882424] [] sysfs_create_dir_ns+0x74/0x94 [ 0.882436] [] kobject_add_internal+0xc8/0x290 [ 0.882446] [] kobject_add+0xe0/0x10c [ 0.882454] [] device_add+0xec/0x508 [ 0.882462] [] device_create_groups_vargs+0xb4/0xf8 [ 0.882471] [] device_create_vargs+0x2c/0x34 [ 0.882479] [] device_create+0x60/0x80 [ 0.882491] [] switch_dev_register+0x8c/0x120 [ 0.882502] [] cdn_dp_bind+0x4c4/0x644 [ 0.882511] [] component_bind_all+0x94/0x1c0 [ 0.882523] [] rockchip_drm_bind+0x1c4/0xb54 [ 0.882533] [] try_to_bring_up_master.part.3+0xac/0x114 [ 0.882542] [] component_add+0x88/0xf8 [ 0.882550] [] cdn_dp_probe+0x140/0x164 [ 0.882559] [] platform_drv_probe+0x58/0xa4 [ 0.882568] [] driver_probe_device+0x118/0x2ac [ 0.882576] [] __device_attach_driver+0x88/0x98 [ 0.882584] [] bus_for_each_drv+0x7c/0xac [ 0.882592] [] __device_attach+0xa4/0x124 [ 0.882600] [] device_initial_probe+0x10/0x18 [ 0.882609] [] bus_probe_device+0x2c/0x8c [ 0.882617] [] deferred_probe_work_func+0x74/0xa0 [ 0.882628] [] process_one_work+0x218/0x3e0 [ 0.882636] [] worker_thread+0x2e8/0x404 [ 0.882644] [] kthread+0xe8/0xf0 [ 0.882653] [] ret_from_fork+0x10/0x40 [ 0.882675] kobject_add_internal failed for hdmi with -EEXIST, don't try to register things with the same name in the same directory. Change-Id: I0c1b175a2483d5524d9cc0e5261d332c5ad286c8 Signed-off-by: Bin Yang --- diff --git a/drivers/gpu/drm/rockchip/cdn-dp-core.c b/drivers/gpu/drm/rockchip/cdn-dp-core.c index a61aca213813..18a724886ecb 100644 --- a/drivers/gpu/drm/rockchip/cdn-dp-core.c +++ b/drivers/gpu/drm/rockchip/cdn-dp-core.c @@ -1119,7 +1119,7 @@ static int cdn_dp_bind(struct device *dev, struct device *master, void *data) drm_connector_helper_add(connector, &cdn_dp_connector_helper_funcs); #ifdef CONFIG_SWITCH - dp->switchdev.name = "hdmi"; + dp->switchdev.name = "cdn-dp"; switch_dev_register(&dp->switchdev); #endif