From fe3a9f4a5a465ac3097d2afd7170d25d2acae913 Mon Sep 17 00:00:00 2001 From: "jino.cho" Date: Thu, 18 May 2017 18:36:20 +0900 Subject: [PATCH] Replace checking validation of the pwm device and channel Change-Id: I13a2b3b14dec162e6abc140def5bb3c4000f9622 Signed-off-by: jino.cho --- src/peripheral_pwm.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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)); -- 2.34.1