linux-stable/drivers/ptp
Jonathan Lemon c223929418 ptp: ocp: change sysfs attr group handling
In the detach path, the driver calls sysfs_remove_group() for the
groups it believes has been registered.  However, if the group was
never previously registered, then this causes a splat.

Instead, compute the groups that should be registered in advance,
and then call sysfs_create_groups(), which registers them all at once.

Update the error handling appropriately.

Fixes: c205d53c49 ("ptp: ocp: Add firmware capability bits for feature gating")
Reported-by: Zheyu Ma <zheyuma97@gmail.com>
Signed-off-by: Jonathan Lemon <jonathan.lemon@gmail.com>
Link: https://lore.kernel.org/r/20220517214600.10606-1-jonathan.lemon@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2022-05-18 21:44:37 -07:00
..
Kconfig ptp: ocp: add COMMON_CLK dependency 2021-09-20 11:11:54 +01:00
Makefile ptp: add ptp virtual clock driver framework 2021-07-01 13:08:18 -07:00
ptp_chardev.c
ptp_clock.c ptp: unregister virtual clocks when unregistering physical clock. 2022-02-03 14:00:57 +00:00
ptp_clockmatrix.c ptp: ptp_clockmatrix: repair non-kernel-doc comment 2021-11-12 19:58:10 -08:00
ptp_clockmatrix.h ptp: clockmatrix: use rsmu driver to access i2c/spi bus 2021-09-27 12:16:48 +01:00
ptp_dte.c
ptp_idt82p33.c ptp: idt82p33: use rsmu driver to access i2c/spi bus 2022-03-09 19:50:57 -08:00
ptp_idt82p33.h ptp: idt82p33: use rsmu driver to access i2c/spi bus 2022-03-09 19:50:57 -08:00
ptp_ines.c net_tstamp: add new flag HWTSTAMP_FLAG_BONDED_PHC_INDEX 2021-12-14 12:28:24 +00: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: fix error print of ptp_kvm on X86_64 platform 2021-10-15 11:19:25 +01:00
ptp_ocp.c ptp: ocp: change sysfs attr group handling 2022-05-18 21:44:37 -07:00
ptp_pch.c ptp_pch: Remove unused pch_pm_ops 2022-02-08 21:04:32 -08:00
ptp_private.h ptp: add kernel API ptp_get_vclocks_index() 2021-07-01 13:08:18 -07:00
ptp_qoriq.c ptp_qoriq: fix overflow in ptp_qoriq_adjfine() u64 calcalation 2021-03-24 12:10:03 -07:00
ptp_qoriq_debugfs.c
ptp_sysfs.c ptp: replace snprintf with sysfs_emit 2022-01-27 14:05:35 +00:00
ptp_vclock.c ptp: add getcrosststamp() to virtual clocks. 2022-02-03 14:00:58 +00:00
ptp_vmw.c