Skip to content

Commit 4ac1704

Browse files
tlebbebarino
authored andcommitted
reset: eyeq: drop device_set_of_node_from_dev() done by parent
Our parent driver (clk-eyeq) now does the device_set_of_node_from_dev(dev, dev->parent) call through the newly introduced devm_auxiliary_device_create() helper. Doing it again in the reset-eyeq probe would be redundant. Drop both the WARN_ON() and the device_set_of_node_from_dev() call. Also fix the following comment that talks about "our newfound OF node". Signed-off-by: Jerome Brunet <jbrunet@baylibre.com> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de> Acked-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
1 parent a25ab51 commit 4ac1704

1 file changed

Lines changed: 2 additions & 22 deletions

File tree

drivers/reset/reset-eyeq.c

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -422,13 +422,6 @@ static int eqr_of_xlate_twocells(struct reset_controller_dev *rcdev,
422422
return eqr_of_xlate_internal(rcdev, reset_spec->args[0], reset_spec->args[1]);
423423
}
424424

425-
static void eqr_of_node_put(void *_dev)
426-
{
427-
struct device *dev = _dev;
428-
429-
of_node_put(dev->of_node);
430-
}
431-
432425
static int eqr_probe(struct auxiliary_device *adev,
433426
const struct auxiliary_device_id *id)
434427
{
@@ -439,21 +432,8 @@ static int eqr_probe(struct auxiliary_device *adev,
439432
int ret;
440433

441434
/*
442-
* We are an auxiliary device of clk-eyeq. We do not have an OF node by
443-
* default; let's reuse our parent's OF node.
444-
*/
445-
WARN_ON(dev->of_node);
446-
device_set_of_node_from_dev(dev, dev->parent);
447-
if (!dev->of_node)
448-
return -ENODEV;
449-
450-
ret = devm_add_action_or_reset(dev, eqr_of_node_put, dev);
451-
if (ret)
452-
return ret;
453-
454-
/*
455-
* Using our newfound OF node, we can get match data. We cannot use
456-
* device_get_match_data() because it does not match reused OF nodes.
435+
* Get match data. We cannot use device_get_match_data() because it does
436+
* not accept reused OF nodes; see device_set_of_node_from_dev().
457437
*/
458438
match = of_match_node(dev->driver->of_match_table, dev->of_node);
459439
if (!match || !match->data)

0 commit comments

Comments
 (0)