[PATCH v4 3/4] ASoC: rockchip: Add machine driver for RK3288 boards that use analog/HDMI

Mark Brown broonie at kernel.org
Mon Jan 23 10:08:28 PST 2017

On Mon, Jan 23, 2017 at 11:41:48AM +0100, Romain Perier wrote:

This looks mostly fine but:

> +	machine->gpio_hp_det = of_get_named_gpio(np,
> +		"rockchip,hp-det-gpios", 0);
> +	if (machine->gpio_hp_det == -EPROBE_DEFER)
> +		return -EPROBE_DEFER;

Rather than explicitly checking for probe defer here it's better to
check for the error code that indicates there's nothing to find (-ENODEV
IIRC but I might be misremembering for GPIO).  That way if there's some
actual error like running out of memory allocating some structure that's
required then we'll not just silently ignore it.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-rockchip/attachments/20170123/8e1f3834/attachment.sig>

More information about the Linux-rockchip mailing list