Commit 64cc80c0 authored by Sergey Ryazanov's avatar Sergey Ryazanov Committed by David S. Miller

net: wwan: core: init port type string array using enum values

This array is indexed by port type. Make it self-descriptive by using
the port type enum values as indices in the array initializer.
Signed-off-by: default avatarSergey Ryazanov <ryazanov.s.a@gmail.com>
Reviewed-by: default avatarLoic Poulain <loic.poulain@linaro.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b64d76b7
...@@ -184,13 +184,12 @@ static void wwan_remove_dev(struct wwan_device *wwandev) ...@@ -184,13 +184,12 @@ static void wwan_remove_dev(struct wwan_device *wwandev)
/* ------- WWAN port management ------- */ /* ------- WWAN port management ------- */
/* Keep aligned with wwan_port_type enum */ static const char * const wwan_port_type_str[WWAN_PORT_MAX + 1] = {
static const char * const wwan_port_type_str[] = { [WWAN_PORT_AT] = "AT",
"AT", [WWAN_PORT_MBIM] = "MBIM",
"MBIM", [WWAN_PORT_QMI] = "QMI",
"QMI", [WWAN_PORT_QCDM] = "QCDM",
"QCDM", [WWAN_PORT_FIREHOSE] = "FIREHOSE",
"FIREHOSE"
}; };
static ssize_t type_show(struct device *dev, struct device_attribute *attr, static ssize_t type_show(struct device *dev, struct device_attribute *attr,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment