platform/x86: intel-uncore-freq: Conditionally create attribute for read frequency
authorSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Wed, 4 Oct 2023 18:19:15 +0000 (11:19 -0700)
committerHans de Goede <hdegoede@redhat.com>
Wed, 11 Oct 2023 09:20:16 +0000 (11:20 +0200)
commit4d73c6772ab771cbbe7e46a73e7c78ba490350fa
treed941fd7590bf0f97062ac9491c5f01fb22f9ffe8
parenta4fdebbe062c0da3284e79641c2d5e67150f0daf
platform/x86: intel-uncore-freq: Conditionally create attribute for read frequency

When the current uncore frequency can't be read, don't create attribute
"current_freq_khz" as any read will fail later. Some user space
applications like turbostat fail to continue with the failure. So, check
error during attribute creation.

Fixes: 414eef27283a ("platform/x86/intel/uncore-freq: Display uncore current frequency")
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20231004181915.1887913-1-srinivas.pandruvada@linux.intel.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
drivers/platform/x86/intel/uncore-frequency/uncore-frequency-common.c