[PATCH v5 6/7] regulator: Add refactored mtk-dvfsrc-regulator driver
AngeloGioacchino Del Regno
angelogioacchino.delregno at collabora.com
Wed Apr 24 05:54:37 PDT 2024
Il 24/04/24 14:53, AngeloGioacchino Del Regno ha scritto:
> Il 24/04/24 12:35, Christophe JAILLET ha scritto:
>> Le 24/04/2024 à 11:54, AngeloGioacchino Del Regno a écrit :
>>> The previous driver never worked, and never got even compiled because
>>> it was missing the DVFSRC driver entirely, including needed neaders.
>>>
>>> This is a full (or nearly full) refactoring of the MediaTek DVFSRC
>>> controlled Regulators driver, retaining support for the MT6873, MT8183
>>> and MT8192 SoC, and adding MT8195.
>>>
>>> As part of the refactoring, this driver is now probed using its own
>>> devicetree compatible, as this is a child of the main DVFSRC driver
>>> and gets probed as a subnode of that.
>>>
>>> Reviewed-by: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A at public.gmane.org>
>>> Signed-off-by: AngeloGioacchino Del Regno
>>> <angelogioacchino.delregno-ZGY8ohtN/8qB+jHODAdFcQ at public.gmane.org>
>>> ---
>>> drivers/regulator/mtk-dvfsrc-regulator.c | 196 +++++++++++++++++++++++
>>> 1 file changed, 196 insertions(+)
>>> create mode 100644 drivers/regulator/mtk-dvfsrc-regulator.c
>>>
>>
>> ...
>>
>>> +static int dvfsrc_vcore_regulator_probe(struct platform_device *pdev)
>>> +{
>>> + struct regulator_config config = { .dev = &pdev->dev };
>>> + const struct dvfsrc_regulator_pdata *pdata;
>>> + int i;
>>> +
>>> + pdata = device_get_match_data(&pdev->dev);
>>> + if (!pdata)
>>> + return -EINVAL;
>>> +
>>> + for (i = 0; i < pdata->size; i++) {
>>> + struct regulator_desc *vrdesc = &pdata->descs[i];
>>> + struct regulator_dev *rdev;
>>> +
>>> + rdev = devm_regulator_register(&pdev->dev, vrdesc, &config);
>>> + if (IS_ERR(rdev)) {
>>> + dev_err(&pdev->dev, "failed to register %s\n", vrdesc->name);
>>> + return PTR_ERR(rdev);
>>
>> Hi,
>>
>> Nit: (in case of v6)
>>
>> dev_err_probe()?
>>
>
> I don't think there's going to be any v6, as there's nothing else to do on
> this series.
>
> Mark, if you want to fix this up before applying, that should then be, exactly
>
> rdev = devm_regulator_register(&pdev->dev, vrdesc, &config);
> if (IS_ERR(rdev))
> dev_err_probe(&pdev->dev, PTR_ERR(rdev),
> "failed to register %s\n", vrdesc->name);
>
Uff! Forgot the return!
rdev = devm_regulator_register(&pdev->dev, vrdesc, &config);
if (IS_ERR(rdev))
return dev_err_probe(&pdev->dev, PTR_ERR(rdev),
"failed to register %s\n", vrdesc->name);
:)))
> Otherwise, nevermind I guess..?
>
> Cheers,
> Angelo
>
>
> _______________________________________________
> Kernel mailing list -- kernel at mailman.collabora.com
> To unsubscribe send an email to kernel-leave at mailman.collabora.com
> This list is managed by https://mailman.collabora.com
More information about the Linux-mediatek
mailing list