dm: platform: clean up assert() for some platform devices

Tracked-On: #3252
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
Reviewed-by: Yonghua Huang <yonghua.huang@intel.com>
This commit is contained in:
Shuo A Liu
2019-06-18 14:00:23 +08:00
committed by wenlingz
parent 1b7995387d
commit db7e7f1c44
4 changed files with 26 additions and 27 deletions

View File

@@ -25,7 +25,6 @@
* SUCH DAMAGE.
*/
#include <assert.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
@@ -35,6 +34,7 @@
#include "types.h"
#include "atkbdc.h"
#include "console.h"
#include "log.h"
/* keyboard device commands */
#define PS2KC_RESET_DEV 0xff
@@ -225,8 +225,6 @@ ps2kbd_keysym_queue(struct ps2kbd_info *kbd,
0x22, 0x35, 0x1a, 0x54, 0x5d, 0x5b, 0x0e, 0x00,
};
/* assert(pthread_mutex_isowned_np(&kbd->mtx)); */
switch (keysym) {
case 0x0 ... 0x7f:
if (!down)
@@ -462,8 +460,10 @@ ps2kbd_init(struct atkbdc_base *base)
struct ps2kbd_info *kbd;
kbd = calloc(1, sizeof(struct ps2kbd_info));
assert(kbd != NULL);
if (!kbd) {
pr_err("%s: alloc memory fail!\n", __func__);
return NULL;
}
pthread_mutex_init(&kbd->mtx, NULL);
fifo_init(kbd);