mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
i2c: qcom-geni: Use device_set_node() helper
Use the device_set_node() helper instead of manually setting
adap.dev.of_node. This:
1. Ensures that if the parent has an of_node, adap.dev.fwnode
also points to the parent's of_node rather than remaining
NULL.
2. Removes the need to handle a parent with an ACPI fwnode
specially, since the generic helpers take care of this too.
Signed-off-by: Hans de Goede <johannes.goede@oss.qualcomm.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
Link: https://patch.msgid.link/20260919141434.22999-1-johannes.goede@oss.qualcomm.com
This commit is contained in:
parent
68f382641f
commit
8027cc6835
|
|
@ -1142,9 +1142,6 @@ static int geni_i2c_probe(struct platform_device *pdev)
|
|||
gi2c->clk_freq_out = I2C_MAX_STANDARD_MODE_FREQ;
|
||||
}
|
||||
|
||||
if (has_acpi_companion(dev))
|
||||
ACPI_COMPANION_SET(&gi2c->adap.dev, ACPI_COMPANION(dev));
|
||||
|
||||
gi2c->irq = platform_get_irq(pdev, 0);
|
||||
if (gi2c->irq < 0)
|
||||
return gi2c->irq;
|
||||
|
|
@ -1170,7 +1167,7 @@ static int geni_i2c_probe(struct platform_device *pdev)
|
|||
|
||||
i2c_set_adapdata(&gi2c->adap, gi2c);
|
||||
gi2c->adap.dev.parent = dev;
|
||||
gi2c->adap.dev.of_node = dev->of_node;
|
||||
device_set_node(&gi2c->adap.dev, dev_fwnode(dev));
|
||||
strscpy(gi2c->adap.name, "Geni-I2C", sizeof(gi2c->adap.name));
|
||||
|
||||
pm_runtime_set_suspended(dev);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user