mirror of
https://github.com/physwizz/a155-U-u1.git
synced 2025-08-04 15:30:24 +00:00
38 lines
851 B
C
38 lines
851 B
C
/*
|
|
* Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
* under the terms of the GNU General Public License version 2
|
|
* as published by the Free Software Foundation.
|
|
*/
|
|
|
|
#include <linux/kernel.h>
|
|
#include <linux/kobject.h>
|
|
#include <linux/slab.h>
|
|
#include <linux/string.h>
|
|
#include <linux/sysfs.h>
|
|
#include "include/defex_internal.h"
|
|
|
|
#ifdef DEFEX_PERMISSIVE_SP
|
|
unsigned char global_safeplace_status = 2;
|
|
#else
|
|
unsigned char global_safeplace_status = 1;
|
|
#endif /* DEFEX_PERMISSIVE_SP */
|
|
|
|
int safeplace_status_store(const char *status_str)
|
|
{
|
|
int ret;
|
|
unsigned int status;
|
|
|
|
if (!status_str)
|
|
return -EINVAL;
|
|
|
|
ret = kstrtouint(status_str, 10, &status);
|
|
if (ret != 0 || status > 2)
|
|
return -EINVAL;
|
|
|
|
global_safeplace_status = status;
|
|
|
|
return 0;
|
|
}
|