Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1270345
| From | Russell King - ARM Linux <linux@arm.linux.org.uk> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 2/2] drm/rockchip: Convert the probe function to the generic drm_of_component_probe() |
| Date | 2015-11-16 17:40 +0100 |
| Message-ID | <qvuYW-1eV-25@gated-at.bofh.it> (permalink) |
| References | <qvtgt-6H-3@gated-at.bofh.it> <qvtgv-6H-55@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
I've tweaked your patch to make the above (buggy) change a little clearer.
On Mon, Nov 16, 2015 at 02:44:53PM +0000, Liviu Dudau wrote:
> - for (i = 0;; i++) {
> - port = of_parse_phandle(np, "ports", i);
> - if (!port)
> - break;
> -
> - if (!of_device_is_available(port->parent)) {
> - of_node_put(port);
> - continue;
> - }
>
> - component_match_add(dev, &match, compare_of, port->parent);
> - of_node_put(port);
> - }
> -static int compare_of(struct device *dev, void *data)
> -{
> - struct device_node *np = data;
> -
> - return dev->of_node == np;
> -}
The original above passes port->parent to component_match_add(). This
means 'np' in the above compare_of() function is 'port->parent'.
This means the above comparison is effectively:
dev->of_node == port->parent
The generic code instead does this:
component_match_add(dev, &match, compare_of, port);
So what we get in the comparison function is 'port' rather than
'port->parent':
> +static int compare_port(struct device *dev, void *data)
> {
> + struct device_node *np = data;
> + return dev->parent->of_node == np;
> +}
which means the comparison is:
dev->parent->of_node == port
which is a different comparison from the above.
You instead want this to be:
return dev->of_node == np->parent;
Heiko, please test the above change to compare_port() - I think you'll
find that will fix your issue.
Thanks.
--
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 0/2] Improve drm_of_component_probe() and move rockchip to use it Liviu Dudau <Liviu.Dudau@arm.com> - 2015-11-16 15:50 +0100
[PATCH 2/2] drm/rockchip: Convert the probe function to the generic drm_of_component_probe() Liviu Dudau <Liviu.Dudau@arm.com> - 2015-11-16 15:50 +0100
Re: [PATCH 2/2] drm/rockchip: Convert the probe function to the generic drm_of_component_probe() Russell King - ARM Linux <linux@arm.linux.org.uk> - 2015-11-16 17:40 +0100
Re: [PATCH 2/2] drm/rockchip: Convert the probe function to the generic drm_of_component_probe() Liviu Dudau <Liviu.Dudau@arm.com> - 2015-11-16 18:00 +0100
Re: [PATCH 2/2] drm/rockchip: Convert the probe function to the generic drm_of_component_probe() Heiko Stübner <heiko@sntech.de> - 2015-11-16 18:10 +0100
Re: [PATCH 0/2] Improve drm_of_component_probe() and move rockchip to use it Heiko Stübner <heiko@sntech.de> - 2015-11-16 17:10 +0100
Re: [PATCH 0/2] Improve drm_of_component_probe() and move rockchip to use it Liviu Dudau <Liviu.Dudau@arm.com> - 2015-11-16 18:00 +0100
csiph-web