提交 320920cb 编写于 作者: P Pavan Savoy 提交者: Greg Kroah-Hartman

Staging: ti-st: make use of linux err codes

remove custom error code definitions from the header and
make use of the agreed upon linux error codes.
Signed-off-by: NPavan Savoy <pavan_savoy@ti.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 771dafdc
...@@ -191,7 +191,7 @@ static int hci_st_open(struct hci_dev *hdev) ...@@ -191,7 +191,7 @@ static int hci_st_open(struct hci_dev *hdev)
/* Register with ST layer */ /* Register with ST layer */
err = st_register(&hci_st_proto); err = st_register(&hci_st_proto);
if (err == ST_ERR_PENDING) { if (err == -EINPROGRESS) {
/* Prepare wait-for-completion handler data structures. /* Prepare wait-for-completion handler data structures.
* Needed to syncronize this and st_registration_completion_cb() * Needed to syncronize this and st_registration_completion_cb()
* functions. * functions.
...@@ -232,7 +232,7 @@ static int hci_st_open(struct hci_dev *hdev) ...@@ -232,7 +232,7 @@ static int hci_st_open(struct hci_dev *hdev)
return -EAGAIN; return -EAGAIN;
} }
err = 0; err = 0;
} else if (err == ST_ERR_FAILURE) { } else if (err == -1) {
BT_DRV_ERR("st_register failed %d", err); BT_DRV_ERR("st_register failed %d", err);
BTDRV_API_EXIT(-EAGAIN); BTDRV_API_EXIT(-EAGAIN);
return -EAGAIN; return -EAGAIN;
...@@ -280,7 +280,7 @@ static int hci_st_close(struct hci_dev *hdev) ...@@ -280,7 +280,7 @@ static int hci_st_close(struct hci_dev *hdev)
/* Unregister from ST layer */ /* Unregister from ST layer */
if (test_and_clear_bit(BT_ST_REGISTERED, &hst->flags)) { if (test_and_clear_bit(BT_ST_REGISTERED, &hst->flags)) {
err = st_unregister(ST_BT); err = st_unregister(ST_BT);
if (err != ST_SUCCESS) { if (err != 0) {
BT_DRV_ERR("st_unregister failed %d", err); BT_DRV_ERR("st_unregister failed %d", err);
BTDRV_API_EXIT(-EBUSY); BTDRV_API_EXIT(-EBUSY);
return -EBUSY; return -EBUSY;
......
...@@ -50,15 +50,6 @@ enum proto_type { ...@@ -50,15 +50,6 @@ enum proto_type {
ST_MAX, ST_MAX,
}; };
enum {
ST_ERR_FAILURE = -1, /* check struct */
ST_SUCCESS,
ST_ERR_PENDING = -5, /* to call reg_complete_cb */
ST_ERR_ALREADY, /* already registered */
ST_ERR_INPROGRESS,
ST_ERR_NOPROTO, /* protocol not supported */
};
/* per protocol structure /* per protocol structure
* for BT/FM and GPS * for BT/FM and GPS
*/ */
......
...@@ -87,7 +87,7 @@ int st_int_write(struct st_data_s *st_gdata, ...@@ -87,7 +87,7 @@ int st_int_write(struct st_data_s *st_gdata,
struct tty_struct *tty; struct tty_struct *tty;
if (unlikely(st_gdata == NULL || st_gdata->tty == NULL)) { if (unlikely(st_gdata == NULL || st_gdata->tty == NULL)) {
pr_err("tty unavailable to perform write"); pr_err("tty unavailable to perform write");
return ST_ERR_FAILURE; return -1;
} }
tty = st_gdata->tty; tty = st_gdata->tty;
#ifdef VERBOSE #ifdef VERBOSE
...@@ -123,7 +123,7 @@ void st_send_frame(enum proto_type protoid, struct st_data_s *st_gdata) ...@@ -123,7 +123,7 @@ void st_send_frame(enum proto_type protoid, struct st_data_s *st_gdata)
*/ */
if (likely(st_gdata->list[protoid]->recv != NULL)) { if (likely(st_gdata->list[protoid]->recv != NULL)) {
if (unlikely(st_gdata->list[protoid]->recv(st_gdata->rx_skb) if (unlikely(st_gdata->list[protoid]->recv(st_gdata->rx_skb)
!= ST_SUCCESS)) { != 0)) {
pr_err(" proto stack %d's ->recv failed", protoid); pr_err(" proto stack %d's ->recv failed", protoid);
kfree_skb(st_gdata->rx_skb); kfree_skb(st_gdata->rx_skb);
return; return;
...@@ -601,7 +601,7 @@ void kim_st_list_protocols(struct st_data_s *st_gdata, char *buf) ...@@ -601,7 +601,7 @@ void kim_st_list_protocols(struct st_data_s *st_gdata, char *buf)
long st_register(struct st_proto_s *new_proto) long st_register(struct st_proto_s *new_proto)
{ {
struct st_data_s *st_gdata; struct st_data_s *st_gdata;
long err = ST_SUCCESS; long err = 0;
unsigned long flags = 0; unsigned long flags = 0;
st_kim_ref(&st_gdata); st_kim_ref(&st_gdata);
...@@ -609,17 +609,17 @@ long st_register(struct st_proto_s *new_proto) ...@@ -609,17 +609,17 @@ long st_register(struct st_proto_s *new_proto)
if (st_gdata == NULL || new_proto == NULL || new_proto->recv == NULL if (st_gdata == NULL || new_proto == NULL || new_proto->recv == NULL
|| new_proto->reg_complete_cb == NULL) { || new_proto->reg_complete_cb == NULL) {
pr_err("gdata/new_proto/recv or reg_complete_cb not ready"); pr_err("gdata/new_proto/recv or reg_complete_cb not ready");
return ST_ERR_FAILURE; return -1;
} }
if (new_proto->type < ST_BT || new_proto->type >= ST_MAX) { if (new_proto->type < ST_BT || new_proto->type >= ST_MAX) {
pr_err("protocol %d not supported", new_proto->type); pr_err("protocol %d not supported", new_proto->type);
return ST_ERR_NOPROTO; return -EPROTONOSUPPORT;
} }
if (st_gdata->list[new_proto->type] != NULL) { if (st_gdata->list[new_proto->type] != NULL) {
pr_err("protocol %d already registered", new_proto->type); pr_err("protocol %d already registered", new_proto->type);
return ST_ERR_ALREADY; return -EALREADY;
} }
/* can be from process context only */ /* can be from process context only */
...@@ -636,7 +636,7 @@ long st_register(struct st_proto_s *new_proto) ...@@ -636,7 +636,7 @@ long st_register(struct st_proto_s *new_proto)
set_bit(ST_REG_PENDING, &st_gdata->st_state); set_bit(ST_REG_PENDING, &st_gdata->st_state);
spin_unlock_irqrestore(&st_gdata->lock, flags); spin_unlock_irqrestore(&st_gdata->lock, flags);
return ST_ERR_PENDING; return -EINPROGRESS;
} else if (st_gdata->protos_registered == ST_EMPTY) { } else if (st_gdata->protos_registered == ST_EMPTY) {
pr_info(" protocol list empty :%d ", new_proto->type); pr_info(" protocol list empty :%d ", new_proto->type);
set_bit(ST_REG_IN_PROGRESS, &st_gdata->st_state); set_bit(ST_REG_IN_PROGRESS, &st_gdata->st_state);
...@@ -651,15 +651,15 @@ long st_register(struct st_proto_s *new_proto) ...@@ -651,15 +651,15 @@ long st_register(struct st_proto_s *new_proto)
* since it involves BT fw download * since it involves BT fw download
*/ */
err = st_kim_start(st_gdata->kim_data); err = st_kim_start(st_gdata->kim_data);
if (err != ST_SUCCESS) { if (err != 0) {
clear_bit(ST_REG_IN_PROGRESS, &st_gdata->st_state); clear_bit(ST_REG_IN_PROGRESS, &st_gdata->st_state);
if ((st_gdata->protos_registered != ST_EMPTY) && if ((st_gdata->protos_registered != ST_EMPTY) &&
(test_bit(ST_REG_PENDING, &st_gdata->st_state))) { (test_bit(ST_REG_PENDING, &st_gdata->st_state))) {
pr_err(" KIM failure complete callback "); pr_err(" KIM failure complete callback ");
st_reg_complete(st_gdata, ST_ERR_FAILURE); st_reg_complete(st_gdata, -1);
} }
return ST_ERR_FAILURE; return -1;
} }
/* the protocol might require other gpios to be toggled /* the protocol might require other gpios to be toggled
...@@ -675,7 +675,7 @@ long st_register(struct st_proto_s *new_proto) ...@@ -675,7 +675,7 @@ long st_register(struct st_proto_s *new_proto)
if ((st_gdata->protos_registered != ST_EMPTY) && if ((st_gdata->protos_registered != ST_EMPTY) &&
(test_bit(ST_REG_PENDING, &st_gdata->st_state))) { (test_bit(ST_REG_PENDING, &st_gdata->st_state))) {
pr_info(" call reg complete callback "); pr_info(" call reg complete callback ");
st_reg_complete(st_gdata, ST_SUCCESS); st_reg_complete(st_gdata, 0);
} }
clear_bit(ST_REG_PENDING, &st_gdata->st_state); clear_bit(ST_REG_PENDING, &st_gdata->st_state);
...@@ -685,7 +685,7 @@ long st_register(struct st_proto_s *new_proto) ...@@ -685,7 +685,7 @@ long st_register(struct st_proto_s *new_proto)
if (st_gdata->list[new_proto->type] != NULL) { if (st_gdata->list[new_proto->type] != NULL) {
pr_err(" proto %d already registered ", pr_err(" proto %d already registered ",
new_proto->type); new_proto->type);
return ST_ERR_ALREADY; return -EALREADY;
} }
spin_lock_irqsave(&st_gdata->lock, flags); spin_lock_irqsave(&st_gdata->lock, flags);
...@@ -709,7 +709,7 @@ long st_register(struct st_proto_s *new_proto) ...@@ -709,7 +709,7 @@ long st_register(struct st_proto_s *new_proto)
default: default:
pr_err("%d protocol not supported", pr_err("%d protocol not supported",
new_proto->type); new_proto->type);
err = ST_ERR_NOPROTO; err = -EPROTONOSUPPORT;
/* something wrong */ /* something wrong */
break; break;
} }
...@@ -730,7 +730,7 @@ EXPORT_SYMBOL_GPL(st_register); ...@@ -730,7 +730,7 @@ EXPORT_SYMBOL_GPL(st_register);
*/ */
long st_unregister(enum proto_type type) long st_unregister(enum proto_type type)
{ {
long err = ST_SUCCESS; long err = 0;
unsigned long flags = 0; unsigned long flags = 0;
struct st_data_s *st_gdata; struct st_data_s *st_gdata;
...@@ -739,7 +739,7 @@ long st_unregister(enum proto_type type) ...@@ -739,7 +739,7 @@ long st_unregister(enum proto_type type)
st_kim_ref(&st_gdata); st_kim_ref(&st_gdata);
if (type < ST_BT || type >= ST_MAX) { if (type < ST_BT || type >= ST_MAX) {
pr_err(" protocol %d not supported", type); pr_err(" protocol %d not supported", type);
return ST_ERR_NOPROTO; return -EPROTONOSUPPORT;
} }
spin_lock_irqsave(&st_gdata->lock, flags); spin_lock_irqsave(&st_gdata->lock, flags);
...@@ -747,7 +747,7 @@ long st_unregister(enum proto_type type) ...@@ -747,7 +747,7 @@ long st_unregister(enum proto_type type)
if (st_gdata->list[type] == NULL) { if (st_gdata->list[type] == NULL) {
pr_err(" protocol %d not registered", type); pr_err(" protocol %d not registered", type);
spin_unlock_irqrestore(&st_gdata->lock, flags); spin_unlock_irqrestore(&st_gdata->lock, flags);
return ST_ERR_NOPROTO; return -EPROTONOSUPPORT;
} }
st_gdata->protos_registered--; st_gdata->protos_registered--;
...@@ -794,7 +794,7 @@ long st_write(struct sk_buff *skb) ...@@ -794,7 +794,7 @@ long st_write(struct sk_buff *skb)
if (unlikely(skb == NULL || st_gdata == NULL if (unlikely(skb == NULL || st_gdata == NULL
|| st_gdata->tty == NULL)) { || st_gdata->tty == NULL)) {
pr_err("data/tty unavailable to perform write"); pr_err("data/tty unavailable to perform write");
return ST_ERR_FAILURE; return -1;
} }
#ifdef DEBUG /* open-up skb to read the 1st byte */ #ifdef DEBUG /* open-up skb to read the 1st byte */
switch (skb->data[0]) { switch (skb->data[0]) {
...@@ -813,7 +813,7 @@ long st_write(struct sk_buff *skb) ...@@ -813,7 +813,7 @@ long st_write(struct sk_buff *skb)
if (unlikely(st_gdata->list[protoid] == NULL)) { if (unlikely(st_gdata->list[protoid] == NULL)) {
pr_err(" protocol %d not registered, and writing? ", pr_err(" protocol %d not registered, and writing? ",
protoid); protoid);
return ST_ERR_FAILURE; return -1;
} }
#endif #endif
pr_info("%d to be written", skb->len); pr_info("%d to be written", skb->len);
...@@ -837,7 +837,7 @@ EXPORT_SYMBOL_GPL(st_unregister); ...@@ -837,7 +837,7 @@ EXPORT_SYMBOL_GPL(st_unregister);
*/ */
static int st_tty_open(struct tty_struct *tty) static int st_tty_open(struct tty_struct *tty)
{ {
int err = ST_SUCCESS; int err = 0;
struct st_data_s *st_gdata; struct st_data_s *st_gdata;
pr_info("%s ", __func__); pr_info("%s ", __func__);
......
...@@ -247,13 +247,13 @@ static long read_local_version(struct kim_data_s *kim_gdata, char *bts_scr_name) ...@@ -247,13 +247,13 @@ static long read_local_version(struct kim_data_s *kim_gdata, char *bts_scr_name)
INIT_COMPLETION(kim_gdata->kim_rcvd); INIT_COMPLETION(kim_gdata->kim_rcvd);
if (4 != st_int_write(kim_gdata->core_data, read_ver_cmd, 4)) { if (4 != st_int_write(kim_gdata->core_data, read_ver_cmd, 4)) {
pr_err("kim: couldn't write 4 bytes"); pr_err("kim: couldn't write 4 bytes");
return ST_ERR_FAILURE; return -1;
} }
if (!wait_for_completion_timeout if (!wait_for_completion_timeout
(&kim_gdata->kim_rcvd, msecs_to_jiffies(CMD_RESP_TIME))) { (&kim_gdata->kim_rcvd, msecs_to_jiffies(CMD_RESP_TIME))) {
pr_err(" waiting for ver info- timed out "); pr_err(" waiting for ver info- timed out ");
return ST_ERR_FAILURE; return -1;
} }
version = version =
...@@ -275,7 +275,7 @@ static long read_local_version(struct kim_data_s *kim_gdata, char *bts_scr_name) ...@@ -275,7 +275,7 @@ static long read_local_version(struct kim_data_s *kim_gdata, char *bts_scr_name)
kim_gdata->version.min_ver = min_ver; kim_gdata->version.min_ver = min_ver;
pr_info("%s", bts_scr_name); pr_info("%s", bts_scr_name);
return ST_SUCCESS; return 0;
} }
/* internal function which parses through the .bts firmware script file /* internal function which parses through the .bts firmware script file
...@@ -283,7 +283,7 @@ static long read_local_version(struct kim_data_s *kim_gdata, char *bts_scr_name) ...@@ -283,7 +283,7 @@ static long read_local_version(struct kim_data_s *kim_gdata, char *bts_scr_name)
*/ */
static long download_firmware(struct kim_data_s *kim_gdata) static long download_firmware(struct kim_data_s *kim_gdata)
{ {
long err = ST_SUCCESS; long err = 0;
long len = 0; long len = 0;
register unsigned char *ptr = NULL; register unsigned char *ptr = NULL;
register unsigned char *action_ptr = NULL; register unsigned char *action_ptr = NULL;
...@@ -292,7 +292,7 @@ static long download_firmware(struct kim_data_s *kim_gdata) ...@@ -292,7 +292,7 @@ static long download_firmware(struct kim_data_s *kim_gdata)
pr_info("%s", __func__); pr_info("%s", __func__);
err = read_local_version(kim_gdata, bts_scr_name); err = read_local_version(kim_gdata, bts_scr_name);
if (err != ST_SUCCESS) { if (err != 0) {
pr_err("kim: failed to read local ver"); pr_err("kim: failed to read local ver");
return err; return err;
} }
...@@ -303,7 +303,7 @@ static long download_firmware(struct kim_data_s *kim_gdata) ...@@ -303,7 +303,7 @@ static long download_firmware(struct kim_data_s *kim_gdata)
(kim_gdata->fw_entry->size == 0))) { (kim_gdata->fw_entry->size == 0))) {
pr_err(" request_firmware failed(errno %ld) for %s", err, pr_err(" request_firmware failed(errno %ld) for %s", err,
bts_scr_name); bts_scr_name);
return ST_ERR_FAILURE; return -1;
} }
ptr = (void *)kim_gdata->fw_entry->data; ptr = (void *)kim_gdata->fw_entry->data;
len = kim_gdata->fw_entry->size; len = kim_gdata->fw_entry->size;
...@@ -338,7 +338,7 @@ static long download_firmware(struct kim_data_s *kim_gdata) ...@@ -338,7 +338,7 @@ static long download_firmware(struct kim_data_s *kim_gdata)
((struct bts_action *)ptr)->size); ((struct bts_action *)ptr)->size);
if (unlikely(err < 0)) { if (unlikely(err < 0)) {
release_firmware(kim_gdata->fw_entry); release_firmware(kim_gdata->fw_entry);
return ST_ERR_FAILURE; return -1;
} }
if (!wait_for_completion_timeout if (!wait_for_completion_timeout
(&kim_gdata->kim_rcvd, (&kim_gdata->kim_rcvd,
...@@ -347,7 +347,7 @@ static long download_firmware(struct kim_data_s *kim_gdata) ...@@ -347,7 +347,7 @@ static long download_firmware(struct kim_data_s *kim_gdata)
(" response timeout during fw download "); (" response timeout during fw download ");
/* timed out */ /* timed out */
release_firmware(kim_gdata->fw_entry); release_firmware(kim_gdata->fw_entry);
return ST_ERR_FAILURE; return -1;
} }
break; break;
case ACTION_DELAY: /* sleep */ case ACTION_DELAY: /* sleep */
...@@ -365,7 +365,7 @@ static long download_firmware(struct kim_data_s *kim_gdata) ...@@ -365,7 +365,7 @@ static long download_firmware(struct kim_data_s *kim_gdata)
} }
/* fw download complete */ /* fw download complete */
release_firmware(kim_gdata->fw_entry); release_firmware(kim_gdata->fw_entry);
return ST_SUCCESS; return 0;
} }
/**********************************************************************/ /**********************************************************************/
...@@ -451,7 +451,7 @@ void st_kim_complete(void *kim_data) ...@@ -451,7 +451,7 @@ void st_kim_complete(void *kim_data)
*/ */
long st_kim_start(void *kim_data) long st_kim_start(void *kim_data)
{ {
long err = ST_SUCCESS; long err = 0;
long retry = POR_RETRY_COUNT; long retry = POR_RETRY_COUNT;
struct kim_data_s *kim_gdata = (struct kim_data_s *)kim_data; struct kim_data_s *kim_gdata = (struct kim_data_s *)kim_data;
...@@ -475,7 +475,7 @@ long st_kim_start(void *kim_data) ...@@ -475,7 +475,7 @@ long st_kim_start(void *kim_data)
err = kill_pid(find_get_pid(kim_gdata->uim_pid), SIGUSR2, 0); err = kill_pid(find_get_pid(kim_gdata->uim_pid), SIGUSR2, 0);
if (err != 0) { if (err != 0) {
pr_info(" sending SIGUSR2 to uim failed %ld", err); pr_info(" sending SIGUSR2 to uim failed %ld", err);
err = ST_ERR_FAILURE; err = -1;
continue; continue;
} }
#endif #endif
...@@ -486,13 +486,13 @@ long st_kim_start(void *kim_data) ...@@ -486,13 +486,13 @@ long st_kim_start(void *kim_data)
msecs_to_jiffies(LDISC_TIME)); msecs_to_jiffies(LDISC_TIME));
if (!err) { /* timeout */ if (!err) { /* timeout */
pr_err("line disc installation timed out "); pr_err("line disc installation timed out ");
err = ST_ERR_FAILURE; err = -1;
continue; continue;
} else { } else {
/* ldisc installed now */ /* ldisc installed now */
pr_info(" line discipline installed "); pr_info(" line discipline installed ");
err = download_firmware(kim_gdata); err = download_firmware(kim_gdata);
if (err != ST_SUCCESS) { if (err != 0) {
pr_err("download firmware failed"); pr_err("download firmware failed");
continue; continue;
} else { /* on success don't retry */ } else { /* on success don't retry */
...@@ -507,7 +507,7 @@ long st_kim_start(void *kim_data) ...@@ -507,7 +507,7 @@ long st_kim_start(void *kim_data)
*/ */
long st_kim_stop(void *kim_data) long st_kim_stop(void *kim_data)
{ {
long err = ST_SUCCESS; long err = 0;
struct kim_data_s *kim_gdata = (struct kim_data_s *)kim_data; struct kim_data_s *kim_gdata = (struct kim_data_s *)kim_data;
INIT_COMPLETION(kim_gdata->ldisc_installed); INIT_COMPLETION(kim_gdata->ldisc_installed);
...@@ -516,7 +516,7 @@ long st_kim_stop(void *kim_data) ...@@ -516,7 +516,7 @@ long st_kim_stop(void *kim_data)
err = kill_pid(find_get_pid(kim_gdata->uim_pid), SIGUSR2, 1); err = kill_pid(find_get_pid(kim_gdata->uim_pid), SIGUSR2, 1);
if (err != 0) { if (err != 0) {
pr_err("sending SIGUSR2 to uim failed %ld", err); pr_err("sending SIGUSR2 to uim failed %ld", err);
return ST_ERR_FAILURE; return -1;
} }
#endif #endif
/* set BT rfkill to be blocked */ /* set BT rfkill to be blocked */
...@@ -527,7 +527,7 @@ long st_kim_stop(void *kim_data) ...@@ -527,7 +527,7 @@ long st_kim_stop(void *kim_data)
msecs_to_jiffies(LDISC_TIME)); msecs_to_jiffies(LDISC_TIME));
if (!err) { /* timeout */ if (!err) { /* timeout */
pr_err(" timed out waiting for ldisc to be un-installed"); pr_err(" timed out waiting for ldisc to be un-installed");
return ST_ERR_FAILURE; return -1;
} }
/* By default configure BT nShutdown to LOW state */ /* By default configure BT nShutdown to LOW state */
...@@ -607,7 +607,7 @@ static int kim_toggle_radio(void *data, bool blocked) ...@@ -607,7 +607,7 @@ static int kim_toggle_radio(void *data, bool blocked)
pr_err(" wrong proto type "); pr_err(" wrong proto type ");
break; break;
} }
return ST_SUCCESS; return 0;
} }
void st_kim_ref(struct st_data_s **core_data) void st_kim_ref(struct st_data_s **core_data)
...@@ -643,7 +643,7 @@ static int kim_probe(struct platform_device *pdev) ...@@ -643,7 +643,7 @@ static int kim_probe(struct platform_device *pdev)
status = st_core_init(&kim_gdata->core_data); status = st_core_init(&kim_gdata->core_data);
if (status != 0) { if (status != 0) {
pr_err(" ST core init failed"); pr_err(" ST core init failed");
return ST_ERR_FAILURE; return -1;
} }
/* refer to itself */ /* refer to itself */
kim_gdata->core_data->kim_data = kim_gdata; kim_gdata->core_data->kim_data = kim_gdata;
...@@ -716,7 +716,7 @@ static int kim_probe(struct platform_device *pdev) ...@@ -716,7 +716,7 @@ static int kim_probe(struct platform_device *pdev)
return -1; return -1;
} }
pr_info(" sysfs entries created "); pr_info(" sysfs entries created ");
return ST_SUCCESS; return 0;
} }
static int kim_remove(struct platform_device *pdev) static int kim_remove(struct platform_device *pdev)
...@@ -745,7 +745,7 @@ static int kim_remove(struct platform_device *pdev) ...@@ -745,7 +745,7 @@ static int kim_remove(struct platform_device *pdev)
kfree(kim_gdata); kfree(kim_gdata);
kim_gdata = NULL; kim_gdata = NULL;
return ST_SUCCESS; return 0;
} }
/**********************************************************************/ /**********************************************************************/
...@@ -753,13 +753,13 @@ static int kim_remove(struct platform_device *pdev) ...@@ -753,13 +753,13 @@ static int kim_remove(struct platform_device *pdev)
static int __init st_kim_init(void) static int __init st_kim_init(void)
{ {
long ret = ST_SUCCESS; long ret = 0;
ret = platform_driver_register(&kim_platform_driver); ret = platform_driver_register(&kim_platform_driver);
if (ret != 0) { if (ret != 0) {
pr_err("platform drv registration failed"); pr_err("platform drv registration failed");
return ST_ERR_FAILURE; return -1;
} }
return ST_SUCCESS; return 0;
} }
static void __exit st_kim_deinit(void) static void __exit st_kim_deinit(void)
......
...@@ -127,9 +127,9 @@ unsigned long st_ll_sleep_state(struct st_data_s *st_data, ...@@ -127,9 +127,9 @@ unsigned long st_ll_sleep_state(struct st_data_s *st_data,
break; break;
default: default:
pr_err(" unknown input/state "); pr_err(" unknown input/state ");
return ST_ERR_FAILURE; return -1;
} }
return ST_SUCCESS; return 0;
} }
/* Called from ST CORE to initialize ST LL */ /* Called from ST CORE to initialize ST LL */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册