[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1f7a47f6-33d0-4e35-bd4f-9d130e37c931@kernel.org>
Date: Tue, 6 May 2025 13:08:32 +0200
From: Krzysztof Kozlowski <krzk@...nel.org>
To: luyulin <luyulin@...incomputing.com>, linus.walleij@...aro.org,
robh@...nel.org, krzk+dt@...nel.org, conor+dt@...nel.org,
linux-gpio@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, kees@...nel.org, gustavoars@...nel.org,
brgl@...ev.pl, linux-hardening@...r.kernel.org
Cc: zhengyu@...incomputing.com, ningyu@...incomputing.com,
huangyifeng@...incomputing.com, linmin@...incomputing.com,
fenglin@...incomputing.com, lianghujun@...incomputing.com,
Samuel Holland <samuel.holland@...ive.com>
Subject: Re: [PATCH 2/2] pinctrl: eswin: Add eic7700 pinctrl driver
On 06/05/2025 11:12, luyulin wrote:
> +static int eic7700_pinctrl_probe(struct platform_device *pdev)
> +{
> + struct device *dev = &pdev->dev;
> + struct pinctrl_dev *pctldev;
> + struct eic7700_pinctrl *pc;
> + struct regulator *regulator;
> + u32 voltage, rgmii0_mode, rgmii1_mode;
> + int ret;
> +
> + pc = devm_kzalloc(dev, struct_size(pc, functions, EIC7700_FUNCTIONS_COUNT), GFP_KERNEL);
> + if (!pc)
> + return -ENOMEM;
> +
> + pc->base = devm_platform_ioremap_resource(pdev, 0);
> + if (IS_ERR(pc->base))
> + return PTR_ERR(pc->base);
> +
> + regulator = devm_regulator_get(dev, "vrgmii");
> + if (IS_ERR_OR_NULL(regulator)) {
> + dev_err(dev, "failed to get vrgmii regulator!\n");
Hm? So here you do not use dev_err_probe, even though it is actually
important, but...
...
> +
> + ret = devm_pinctrl_register_and_init(dev, &pc->desc, pc, &pctldev);
> + if (ret)
> + return dev_err_probe(dev, ret, "could not register pinctrl driver\n");
Here you use, even though here it actually does not matter? It makes no
sense, it is not logical. If using dev_err_probe selectively, then use
it when it matters - so for probe deferal. Or preferred is to use it always.
Best regards,
Krzysztof
Powered by blists - more mailing lists