diff options
author | Sergey Ryazanov <ryazanov.s.a@gmail.com> | 2021-06-08 07:02:34 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-06-08 14:33:43 -0700 |
commit | b64d76b782264aa91c236c11c72646459b04c301 (patch) | |
tree | 0ac4aa6fa6761b5f443fc935d712fb9ed2ba6be1 /drivers/net/wwan | |
parent | 9ee23f48f6705fff6c23e02c4ab1e6d99369cd05 (diff) |
net: wwan: make WWAN_PORT_MAX meaning less surprised
It is quite unusual when some value can not be equal to a defined range
max value. Also most subsystems defines FOO_TYPE_MAX as a maximum valid
value. So turn the WAN_PORT_MAX meaning from the number of supported
port types to the maximum valid port type.
Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
Reviewed-by: Loic Poulain <loic.poulain@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wwan')
-rw-r--r-- | drivers/net/wwan/wwan_core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/wwan/wwan_core.c b/drivers/net/wwan/wwan_core.c index 6e8f19c71a9e..632ff86398ac 100644 --- a/drivers/net/wwan/wwan_core.c +++ b/drivers/net/wwan/wwan_core.c @@ -250,7 +250,7 @@ struct wwan_port *wwan_create_port(struct device *parent, struct wwan_port *port; int minor, err = -ENOMEM; - if (type >= WWAN_PORT_MAX || !ops) + if (type > WWAN_PORT_MAX || !ops) return ERR_PTR(-EINVAL); /* A port is always a child of a WWAN device, retrieve (allocate or |