Re: [PATCH 4.19.y-cip 05/23] usb: typec: Find the ports by also matching against the device node

Pavel Machek
2020-02-19T07:56:34Z

[-- Attachment #1: Type: text/plain, Size: 1219 bytes --]

Hi!

> From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
>
> commit 6a0bbcf96b2273f110a14d11a5952527c5921191 upstream.
>
> When the connections are defined in firmware, struct
> device_connection will have the fwnode member pointing to
> the device node (struct fwnode_handle) of the requested
> device, and the endpoint will not be used at all in that
> case.

> static void *typec_port_match(struct device_connection *con, int ep, void *data)
> {
> - return class_find_device(typec_class, NULL, con->endpoint[ep],
> - __typec_port_match);
...
> + dev = class_find_device(typec_class, NULL, con->endpoint[ep],
> + typec_port_name_match);
> +
> + return dev ? dev : ERR_PTR(-EPROBE_DEFER);
> }

So... this adds handling in fwnode != NULL (expected, okay with me),
but it also changes behaviour in fwnode == NULL case: return value
changed from NULL to ERR_PTR(-EPROBE_DEFER). Are all callers ready to
handle the changed situation in -cip? Could we get some explanation
why it is neccessary/good idea?

Best regards,
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]