aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergio Paracuellos <sergio.paracuellos@gmail.com>2018-06-28 21:03:07 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-07-06 17:33:43 +0200
commit74ee97cc05110a8421fe554506309fe071103654 (patch)
tree58ce340a6324817a7bda1cedf731f877acaaf283
parente12a1a6e087b9803befc6e9ab47734716c3e20e2 (diff)
downloadstaging-74ee97cc05110a8421fe554506309fe071103654.tar.gz
staging: mt7621-pinctrl: use ternary operator return in rt2880_get_group_name
Trivial change to have only one return in 'rt2880_get_group_name' function using a ternary operator instead of an if statement and two returns. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
index c022718d8000a..a15e8e8c0ed1a 100644
--- a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
+++ b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
@@ -54,10 +54,7 @@ static const char *rt2880_get_group_name(struct pinctrl_dev *pctrldev,
{
struct rt2880_priv *p = pinctrl_dev_get_drvdata(pctrldev);
- if (group >= p->group_count)
- return NULL;
-
- return p->group_names[group];
+ return (group >= p->group_count) ? NULL : p->group_names[group];
}
static int rt2880_get_group_pins(struct pinctrl_dev *pctrldev,