mirror of
https://github.com/torvalds/linux.git
synced 2026-05-29 17:43:52 +02:00
wifi: iwlwifi: handle NULL/ERR returns from ptp_clock_register()
ptp_clock_register() returns NULL when PTP support is disabled and may return an ERR_PTR() on other failures. Reduce Log severity for NULL return cases to avoid misleading errors when PTP is unavailable. Signed-off-by: Avinash Bhatt <avinash.bhatt@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://patch.msgid.link/20260321192637.adea594600e8.I0e3d3f7ce897c54fff8ace6dd0faf55b4f39832b@changeid
This commit is contained in:
parent
350d91a2ae
commit
19a86a3ff3
|
|
@ -301,10 +301,12 @@ void iwl_mld_ptp_init(struct iwl_mld *mld)
|
|||
mld->ptp_data.ptp_clock =
|
||||
ptp_clock_register(&mld->ptp_data.ptp_clock_info, mld->dev);
|
||||
|
||||
if (IS_ERR_OR_NULL(mld->ptp_data.ptp_clock)) {
|
||||
if (IS_ERR(mld->ptp_data.ptp_clock)) {
|
||||
IWL_ERR(mld, "Failed to register PHC clock (%ld)\n",
|
||||
PTR_ERR(mld->ptp_data.ptp_clock));
|
||||
mld->ptp_data.ptp_clock = NULL;
|
||||
} else if (!mld->ptp_data.ptp_clock) {
|
||||
IWL_DEBUG_INFO(mld, "PTP module unavailable on this kernel\n");
|
||||
} else {
|
||||
IWL_DEBUG_INFO(mld, "Registered PHC clock: %s, with index: %d\n",
|
||||
mld->ptp_data.ptp_clock_info.name,
|
||||
|
|
|
|||
|
|
@ -304,7 +304,9 @@ void iwl_mvm_ptp_init(struct iwl_mvm *mvm)
|
|||
IWL_ERR(mvm, "Failed to register PHC clock (%ld)\n",
|
||||
PTR_ERR(mvm->ptp_data.ptp_clock));
|
||||
mvm->ptp_data.ptp_clock = NULL;
|
||||
} else if (mvm->ptp_data.ptp_clock) {
|
||||
} else if (!mvm->ptp_data.ptp_clock) {
|
||||
IWL_DEBUG_INFO(mvm, "PTP module unavailable on this kernel\n");
|
||||
} else {
|
||||
IWL_DEBUG_INFO(mvm, "Registered PHC clock: %s, with index: %d\n",
|
||||
mvm->ptp_data.ptp_clock_info.name,
|
||||
ptp_clock_index(mvm->ptp_data.ptp_clock));
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user