[PATCH v3 1/3] reset: Make [of_]reset_control_get[_foo] functions wrappers

Philipp Zabel p.zabel at pengutronix.de
Thu Feb 4 08:54:26 PST 2016


Hi Hans,

Am Mittwoch, den 27.01.2016, 19:15 +0100 schrieb Hans de Goede:
[...]
> +/**
> + * reset_control_get - Lookup and obtain a reference to a reset controller.
> + * @dev: device to be reset by the controller
> + * @id: reset line name
> + *
> + * Returns a struct reset_control or IS_ERR() condition containing errno.
> + *
> + * Use of id names is optional.
> + */
> +static inline struct reset_control *__must_check reset_control_get(
>  					struct device *dev, const char *id)
>  {
> -	return ERR_PTR(-ENOTSUPP);
> +#ifndef CONFIG_RESET_CONTROLLER
> +	WARN_ON(1);
> +#endif
> +	return __of_reset_control_get(dev ? dev->of_node : NULL, id, 0);

Even though we are device tree only at this point, I'd prefer to keep an
exported function that takes a struct device argument, for example:

	return __reset_control_get(dev, id, 0);

regards
Philipp




More information about the linux-arm-kernel mailing list