]> git.kernelconcepts.de Git - karo-tx-linux.git/blob - drivers/staging/ccree/ssi_fips.c
staging: ccree: remove comparisons to NULL
[karo-tx-linux.git] / drivers / staging / ccree / ssi_fips.c
1 /*
2  * Copyright (C) 2012-2017 ARM Limited or its affiliates.
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, see <http://www.gnu.org/licenses/>.
15  */
16
17
18 /**************************************************************
19  * This file defines the driver FIPS APIs                     *
20  **************************************************************/
21
22 #include <linux/module.h>
23 #include "ssi_fips.h"
24
25
26 extern int ssi_fips_ext_get_state(ssi_fips_state_t *p_state);
27 extern int ssi_fips_ext_get_error(ssi_fips_error_t *p_err);
28
29 /*
30  * This function returns the REE FIPS state.
31  * It should be called by kernel module.
32  */
33 int ssi_fips_get_state(ssi_fips_state_t *p_state)
34 {
35         int rc = 0;
36
37         if (!p_state)
38                 return -EINVAL;
39
40         rc = ssi_fips_ext_get_state(p_state);
41
42         return rc;
43 }
44
45 EXPORT_SYMBOL(ssi_fips_get_state);
46
47 /*
48  * This function returns the REE FIPS error.
49  * It should be called by kernel module.
50  */
51 int ssi_fips_get_error(ssi_fips_error_t *p_err)
52 {
53         int rc = 0;
54
55         if (!p_err)
56                 return -EINVAL;
57
58         rc = ssi_fips_ext_get_error(p_err);
59
60         return rc;
61 }
62
63 EXPORT_SYMBOL(ssi_fips_get_error);