From: jino.cho Date: Thu, 18 May 2017 09:36:20 +0000 (+0900) Subject: Replace checking validation of the pwm device and channel X-Git-Tag: submit/tizen/20170602.034029~15 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F99%2F129899%2F1;p=platform%2Fcore%2Fapi%2Fperipheral-io.git Replace checking validation of the pwm device and channel Change-Id: I13a2b3b14dec162e6abc140def5bb3c4000f9622 Signed-off-by: jino.cho --- diff --git a/src/peripheral_pwm.c b/src/peripheral_pwm.c index 354ad80..607c8f8 100644 --- a/src/peripheral_pwm.c +++ b/src/peripheral_pwm.c @@ -24,13 +24,12 @@ #include "peripheral_common.h" #include "peripheral_internal.h" -int peripheral_pwm_open(int device, int channel, peripheral_pwm_h* pwm) +int peripheral_pwm_open(int device, int channel, peripheral_pwm_h *pwm) { peripheral_pwm_h handle; int ret = PERIPHERAL_ERROR_NONE; - assert(device >= 0); - assert(channel >= 0); + if (device < 0 || channel < 0) return PERIPHERAL_ERROR_INVALID_PARAMETER; /* Initialize */ handle = (peripheral_pwm_h)calloc(1, sizeof(struct _peripheral_pwm_s));