Hi,
On Sat, Jun 5, 2021 at 9:40 PM Bjorn Andersson bjorn.andersson@linaro.org wrote:
/*
* We couldn't do this pre-probe because it would confuse pinctrl.
* It would have tried to grab the same pins that the main device had.
* Set it now so that we can put the proper (sub) device in the aux
* structure and it will have the right node.
*/
adev->dev.of_node = pdata->dev->of_node;
I suspect the refcount of the of_node will be wrong here and upon removing the aux device things will be off...
Instead, I think you're looking for device_set_of_node_from_dev(), which also sets of_node_reused, which in turn causes pinctrl_bind_pins() to be skipped - i.e. it seems to deal with the problem your comment describes.
You rock! This is exactly what I wanted. I wish I had thought to look for it--I somehow just assumed that this wasn't already a solved problem.
-Doug