Replace checking validation of the pwm device and channel 99/129899/1
authorjino.cho <jino.cho@samsung.com>
Thu, 18 May 2017 09:36:20 +0000 (18:36 +0900)
committerjino.cho <jino.cho@samsung.com>
Thu, 18 May 2017 09:36:20 +0000 (18:36 +0900)
Change-Id: I13a2b3b14dec162e6abc140def5bb3c4000f9622
Signed-off-by: jino.cho <jino.cho@samsung.com>
src/peripheral_pwm.c

index 354ad80..607c8f8 100644 (file)
 #include "peripheral_common.h"
 #include "peripheral_internal.h"
 
-int peripheral_pwm_open(int device, int channel, peripheral_pwm_hpwm)
+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));