mirror of
https://github.com/wessel-novacustom/clevo-keyboard.git
synced 2024-11-15 03:34:01 +01:00
Add visible error on missing uw interface read/write attempt
This commit is contained in:
parent
16f7c246dd
commit
931d3c7f30
|
@ -97,23 +97,31 @@ uniwill_event_callb_t uniwill_event_callb;
|
||||||
|
|
||||||
u32 uniwill_read_ec_ram(u16 address, u8 *data)
|
u32 uniwill_read_ec_ram(u16 address, u8 *data)
|
||||||
{
|
{
|
||||||
if (!IS_ERR_OR_NULL(uniwill_interfaces.wmi))
|
u32 status;
|
||||||
uniwill_interfaces.wmi->read_ec_ram(address, data);
|
|
||||||
else
|
|
||||||
return -EIO;
|
|
||||||
|
|
||||||
return 0;
|
if (!IS_ERR_OR_NULL(uniwill_interfaces.wmi))
|
||||||
|
status = uniwill_interfaces.wmi->read_ec_ram(address, data);
|
||||||
|
else {
|
||||||
|
pr_err("no active interface while read addr 0x%04x\n", address);
|
||||||
|
status = -EIO;
|
||||||
|
}
|
||||||
|
|
||||||
|
return status;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(uniwill_read_ec_ram);
|
EXPORT_SYMBOL(uniwill_read_ec_ram);
|
||||||
|
|
||||||
u32 uniwill_write_ec_ram(u16 address, u8 data)
|
u32 uniwill_write_ec_ram(u16 address, u8 data)
|
||||||
{
|
{
|
||||||
if (!IS_ERR_OR_NULL(uniwill_interfaces.wmi))
|
u32 status;
|
||||||
uniwill_interfaces.wmi->write_ec_ram(address, data);
|
|
||||||
else
|
|
||||||
return -EIO;
|
|
||||||
|
|
||||||
return 0;
|
if (!IS_ERR_OR_NULL(uniwill_interfaces.wmi))
|
||||||
|
status = uniwill_interfaces.wmi->write_ec_ram(address, data);
|
||||||
|
else {
|
||||||
|
pr_err("no active interface while write addr 0x%04x data 0x%02x\n", address, data);
|
||||||
|
status = -EIO;
|
||||||
|
}
|
||||||
|
|
||||||
|
return status;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(uniwill_write_ec_ram);
|
EXPORT_SYMBOL(uniwill_write_ec_ram);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue