[PATCH v3 2/2] mfd: i3c: Add driver for NXP P3H2x4x i3c-hub device

Krzysztof Kozlowski krzk at kernel.org
Mon Aug 11 00:01:53 PDT 2025


On Fri, Aug 08, 2025 at 04:20:33PM +0300, Aman Kumar Pandey wrote:
> +static int p3h2x4x_device_probe_i3c(struct i3c_device *i3cdev)
> +{
> +	struct p3h2x4x_dev *p3h2x4x;
> +	int ret;
> +
> +	p3h2x4x = devm_kzalloc(&i3cdev->dev, sizeof(*p3h2x4x), GFP_KERNEL);
> +	if (!p3h2x4x)
> +		return -ENOMEM;
> +
> +	i3cdev_set_drvdata(i3cdev, p3h2x4x);
> +
> +	p3h2x4x->regmap = devm_regmap_init_i3c(i3cdev, &p3h2x4x_regmap_config);
> +	if (IS_ERR(p3h2x4x->regmap)) {
> +		ret = PTR_ERR(p3h2x4x->regmap);

Drop, don't create useless assignments.

> +		return dev_err_probe(&i3cdev->dev, ret, "Failed to register I3C HUB regmap\n");

Best regards,
Krzysztof




More information about the linux-i3c mailing list