From c5d95eb4c72a2639c10d01a801df00b4c34db315 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Fri, 7 Apr 2017 11:57:08 +0200 Subject: param: make parameter functions more consistent This patch creates a consitent set of device parameter functions. With this we have: dev_add_param_ "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 --- drivers/amba/bus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/amba/bus.c') diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c index ddd9661806..ae5df13c96 100644 --- a/drivers/amba/bus.c +++ b/drivers/amba/bus.c @@ -155,7 +155,7 @@ int amba_device_add(struct amba_device *dev) if (ret) goto err_release; - dev_add_param_int_ro(&dev->dev, "periphid", dev->periphid, "0x%08x"); + dev_add_param_uint32_fixed(&dev->dev, "periphid", dev->periphid, "0x%08x"); return ret; err_release: -- cgit v1.2.3