ucsi_ccg: Don't show non-functional attributes
authorMario Limonciello <mario.limonciello@amd.com>
Fri, 21 Feb 2025 05:40:04 +0000 (23:40 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 3 Mar 2025 09:24:24 +0000 (10:24 +0100)
commit403849c8edc1551d1a489b1b942f68d75758e98a
tree2f579b8cd7b256c32938e09efef1d0ddfac75fd8
parentc16006852732dc4fe37c14b81f9b4458df05b832
ucsi_ccg: Don't show non-functional attributes

If no fw_build is recognized for the controller there is no point to
exposing the `do_flash` attribute.

Add an is_visible callback to the attribute group and check for that
fw_build member to hide when not applicable.

Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20250221054137.1631765-3-superm1@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/ucsi/ucsi_ccg.c