Re: [PATCH v4 2/5] iio: adc: add Versal SysMon driver

From: Andy Shevchenko

Date: Tue Jun 09 2026 - 13:35:58 EST


On Sun, Jun 07, 2026 at 09:45:50PM +0100, Erim, Salih wrote:
> On 07/06/2026 09:06, Andy Shevchenko wrote:
> > On Sat, Jun 06, 2026 at 06:17:04AM +0100, Salih Erim wrote:

...

> > > +/**
> > > + * sysmon_core_probe() - Initialize Versal SysMon core
> > > + * @dev: Parent device
> > > + * @regmap: Register map for hardware access
> > > + *
> > > + * Return: 0 on success, negative errno on failure.
> > > + */
> > > +int sysmon_core_probe(struct device *dev, struct regmap *regmap)
> >
> > I'm wondering if the @regmap is the same as you can get from @dev via
> > respective API.
>
> Yes, dev_get_regmap(dev, NULL) would work since devm_regmap_init
> registers it with devres. However, the explicit parameter makes
> the dependency clear and avoids coupling core_probe to the devres
> registration order. Happy to change if you prefer dev_get_regmap().

Depends on the requirement. If regmap is mandatory and if it's required
to be present before calling this common probe function. However since
it's a library function for probe stage I'm okay with the parameter.

--
With Best Regards,
Andy Shevchenko