linux/drivers/ptp
Leon Romanovsky 919d13a7e4 devlink: Set device as early as possible
All kernel devlink implementations call to devlink_alloc() during
initialization routine for specific device which is used later as
a parent device for devlink_register().

Such late device assignment causes to the situation which requires us to
call to device_register() before setting other parameters, but that call
opens devlink to the world and makes accessible for the netlink users.

Any attempt to move devlink_register() to be the last call generates the
following error due to access to the devlink->dev pointer.

[    8.758862]  devlink_nl_param_fill+0x2e8/0xe50
[    8.760305]  devlink_param_notify+0x6d/0x180
[    8.760435]  __devlink_params_register+0x2f1/0x670
[    8.760558]  devlink_params_register+0x1e/0x20

The simple change of API to set devlink device in the devlink_alloc()
instead of devlink_register() fixes all this above and ensures that
prior to call to devlink_register() everything already set.

Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2021-08-09 10:21:40 +01:00
..
idt8a340_reg.h ptp: ptp_clockmatrix: Add wait_for_sys_apll_dpll_lock. 2021-02-17 13:49:25 -08:00
Kconfig ptp: ocp: Expose various resources on the timecard. 2021-08-04 12:52:50 +01:00
Makefile ptp: add ptp virtual clock driver framework 2021-07-01 13:08:18 -07:00
ptp_chardev.c ptp: only allow phase values lower than 1 period 2020-08-05 12:06:44 -07:00
ptp_clock.c ptp: Relocate lookup cookie to correct block. 2021-07-08 12:33:10 -07:00
ptp_clockmatrix.c ptp: ptp_clockmatrix: Demote non-kernel-doc header to standard comment 2021-03-12 17:09:34 -08:00
ptp_clockmatrix.h ptp: ptp_clockmatrix: Remove unused header declarations. 2021-02-17 13:49:25 -08:00
ptp_dte.c ptp: ptp_dte: use devm_platform_ioremap_resource() to simplify code 2019-10-10 16:21:13 -07:00
ptp_idt82p33.c ptp: idt82p33: optimize _idt82p33_adjfine 2020-11-07 13:10:31 -08:00
ptp_idt82p33.h ptp: idt82p33: use i2c_master_send for bus write 2020-11-07 13:10:27 -08:00
ptp_ines.c ptp: ptp_ines: use new PTP_MSGTYPE_* define(s) 2020-11-23 13:43:39 -08:00
ptp_kvm_arm.c ptp: arm/arm64: Enable ptp_kvm for arm/arm64 2021-04-07 16:33:20 +01:00
ptp_kvm_common.c ptp: Don't print an error if ptp_kvm is not supported 2021-04-20 17:17:55 +01:00
ptp_kvm_x86.c ptp: Reorganize ptp_kvm.c to make it arch-independent 2021-04-07 16:33:07 +01:00
ptp_ocp.c devlink: Set device as early as possible 2021-08-09 10:21:40 +01:00
ptp_pch.c ptp: ptp_p: Demote non-conformant kernel-doc headers and supply a param description 2021-03-12 17:09:34 -08:00
ptp_private.h ptp: add kernel API ptp_get_vclocks_index() 2021-07-01 13:08:18 -07:00
ptp_qoriq_debugfs.c ptp_qoriq: add little enadian support 2019-02-12 12:58:48 -05:00
ptp_qoriq.c ptp_qoriq: fix overflow in ptp_qoriq_adjfine() u64 calcalation 2021-03-24 12:10:03 -07:00
ptp_sysfs.c ptp: fix format string mismatch in ptp_sysfs.c 2021-07-05 10:10:41 -07:00
ptp_vclock.c ptp: add kernel API ptp_convert_timestamp() 2021-07-01 13:08:18 -07:00
ptp_vmw.c ptp: add VMware virtual PTP clock driver 2020-03-05 17:25:07 -08:00