Re: [PATCH v9 3/5] mfd: hi6421-spmi-pmic: move driver from staging
From: Dan Carpenter
Date: Mon Jun 28 2021 - 04:13:47 EST
On Fri, Jun 25, 2021 at 07:06:12PM +0200, Mauro Carvalho Chehab wrote:
> +static int hi6421_spmi_pmic_probe(struct spmi_device *pdev)
> +{
> + struct device *dev = &pdev->dev;
> + int ret;
> + struct hi6421_spmi_pmic *ddata;
> + ddata = devm_kzalloc(dev, sizeof(*ddata), GFP_KERNEL);
No blank line. Checkpatch.
> + if (!ddata)
> + return -ENOMEM;
> +
> + ddata->regmap = devm_regmap_init_spmi_ext(pdev, ®map_config);
> + if (IS_ERR(ddata->regmap))
> + return PTR_ERR(ddata->regmap);
> +
> + mutex_init(&ddata->enable_mutex);
> +
> + dev_set_drvdata(&pdev->dev, ddata);
> +
> + ret = devm_mfd_add_devices(&pdev->dev, PLATFORM_DEVID_NONE,
> + hi6421v600_devs, ARRAY_SIZE(hi6421v600_devs),
> + NULL, 0, NULL);
> + if (ret < 0)
> + dev_err(dev, "Failed to add child devices: %d\n", ret);
> +
> + return ret;
> +}
regards,
dan carpenter