Re: [PATCH v1 3/7] power: reset: qcom-pon: Migrate to devm_spmi_subdevice_alloc_and_add()

From: AngeloGioacchino Del Regno
Date: Tue Jul 22 2025 - 04:24:16 EST


Il 21/07/25 19:14, Andy Shevchenko ha scritto:
On Mon, Jul 21, 2025 at 03:05:46PM +0200, AngeloGioacchino Del Regno wrote:
Il 21/07/25 13:36, Andy Shevchenko ha scritto:
On Mon, Jul 21, 2025 at 09:55:21AM +0200, AngeloGioacchino Del Regno wrote:

...

+ if (!pdev->dev.parent)
+ return -ENODEV;

You can start using

struct device *dev = &pdev->dev;

here and perhaps one may convert the rest to it...

...

error = of_property_read_u32(pdev->dev.of_node, "reg",

...including, but not limited to, use of device_property_read_u32(dev, ...) here.


I didn't do that for one single reason: I did not want to add noise to the commits
and wanted those to exclusively migrate the drivers to the new API, literally
without doing *anything* else unnecessary, even if I have located some almost
effortless improvements that I could've done to those drivers.

Please - I prefer to keep it this way: these are the first commits that add the
usage of the new functions and of the concept of SPMI subdevices, and I really
want those to contain just that and nothing else - because I suspect that these
will be taken as example and will be read by the next person that is implementing
a new SPMI (sub)driver or converting any remaining ones to subdevice.

You can introduce a temporary variable in this change and use it only in the
lines you have added/touched. We have similar approach in several drivers.
Then somebody (not specifically should be you) can move it forward.


Makes sense, okay!

Cheers,
Angelo