lkml.org 
[lkml]   [2020]   [Feb]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 2/2] watchdog: Add new arm_smc_wdt watchdog driver
> > +     if ((int)res->a0 == PSCI_RET_NOT_SUPPORTED)
> > + return -ENOTSUPP;
>
> -ENODEV would be better here.
>
> > + if ((int)res->a0 == PSCI_RET_INVALID_PARAMS)
> > + return -EINVAL;
> > + if ((int)res->a0 < 0)
> > + return -EIO;

In fixing this I found drivers/firmware/psci/psci.c:145
Which also translates psci codes to errno codes, but uses EOPNOTSUPP:

switch (errno) {
case PSCI_RET_SUCCESS:
return 0;
case PSCI_RET_NOT_SUPPORTED:
return -EOPNOTSUPP;
case PSCI_RET_INVALID_PARAMS:
case PSCI_RET_INVALID_ADDRESS:
return -EINVAL;
case PSCI_RET_DENIED:
return -EPERM;
};

return -EINVAL;

Are these more appropriate?

Evan

\
 
 \ /
  Last update: 2020-02-20 07:50    [W:0.133 / U:13.236 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site