summaryrefslogtreecommitdiffstats
path: root/drivers/staging
diff options
context:
space:
mode:
authorDaeseok Youn <daeseok.youn@gmail.com>2016-05-04 14:13:48 +0900
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-05-09 14:10:03 +0200
commita5b90ef7a1fed3fc0f7a4bf0ad0159eaddb2acfb (patch)
tree09fc2e8490f46bd597dbe0ed90357ea757b6b8f0 /drivers/staging
parent1b30ccded52fb2b297128b190b47641457ecc8f5 (diff)
downloadlinux-a5b90ef7a1fed3fc0f7a4bf0ad0159eaddb2acfb.tar.bz2
staging: dgnc: clean up the dgnc_get_modem_info()
the "ch" in dgnc_get_modem_info() was already checked before calling this function and also if "ch" is not NULL, dgnc_get_mstat() returns valid value so it doesn't need to check an error. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/dgnc/dgnc_tty.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c
index 392d5328c7d9..a5057757eb15 100644
--- a/drivers/staging/dgnc/dgnc_tty.c
+++ b/drivers/staging/dgnc/dgnc_tty.c
@@ -2020,17 +2020,7 @@ static inline int dgnc_get_mstat(struct channel_t *ch)
static int dgnc_get_modem_info(struct channel_t *ch,
unsigned int __user *value)
{
- int result;
-
- if (!ch || ch->magic != DGNC_CHANNEL_MAGIC)
- return -ENXIO;
-
- result = dgnc_get_mstat(ch);
-
- if (result < 0)
- return -ENXIO;
-
- return put_user(result, value);
+ return put_user(dgnc_get_mstat(ch), value);
}
/*