diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2017-04-07 11:57:08 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2017-04-11 08:33:48 +0200 |
commit | c5d95eb4c72a2639c10d01a801df00b4c34db315 (patch) | |
tree | 5b8c0afce59f832d2f102e4114feb3c16ffd98a0 /drivers/efi | |
parent | c0511abbd1fa99ee8eff80d5bf207ff5f349cf8a (diff) | |
download | barebox-c5d95eb4c72a2639c10d01a801df00b4c34db315.tar.gz barebox-c5d95eb4c72a2639c10d01a801df00b4c34db315.tar.xz |
param: make parameter functions more consistent
This patch creates a consitent set of device parameter functions.
With this we have: dev_add_param_<type><access>
"type" is one of: int32, uint32, int64, uint64, string, mac, ipv4, enum, bitmask
The improvement here is that we now can exactly specify the width of the
int type parameters and also correctly distinguish between signed and
unsigned variables which means that a variable no longer ends up with
INT_MAX when it's assigned -1.
"access" can be empty for regular read/write parameter, "_ro" for readonly
parameters which get their value from a variable pointer in the
background or "_fixed" for parameters which are set to a fixed value
(without a pointer in the background).
Some more exotic types are not (yet) implemented, like
dev_add_param_ip_ro.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/efi')
-rw-r--r-- | drivers/efi/efi-device.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/efi/efi-device.c b/drivers/efi/efi-device.c index e9b03cb02a..9975aea6f7 100644 --- a/drivers/efi/efi-device.c +++ b/drivers/efi/efi-device.c @@ -404,12 +404,12 @@ static int efi_init_devices(void) dev_add_param_fixed(efi_bus.dev, "fw_vendor", fw_vendor); free(fw_vendor); - dev_add_param_int_ro(efi_bus.dev, "major", sys_major, "%u"); - dev_add_param_int_ro(efi_bus.dev, "minor", sys_minor, "%u"); - dev_add_param_int_ro(efi_bus.dev, "fw_revision", efi_sys_table->fw_revision, "%u"); - dev_add_param_int_ro(efi_bus.dev, "secure_boot", secure_boot, "%d"); - dev_add_param_int_ro(efi_bus.dev, "secure_mode", - secure_boot & setup_mode, "%u"); + dev_add_param_uint32_fixed(efi_bus.dev, "major", sys_major, "%u"); + dev_add_param_uint32_fixed(efi_bus.dev, "minor", sys_minor, "%u"); + dev_add_param_uint32_fixed(efi_bus.dev, "fw_revision", efi_sys_table->fw_revision, "%u"); + dev_add_param_bool_fixed(efi_bus.dev, "secure_boot", secure_boot); + dev_add_param_bool_fixed(efi_bus.dev, "secure_mode", + secure_boot & setup_mode); efi_bus.dev->info = efi_businfo; |