Re: [PATCH 3/5] staging: drivers: regulator: Add MAX77541 Regulator Support

From: Andy Shevchenko
Date: Wed Dec 07 2022 - 06:17:15 EST


On Wed, Dec 07, 2022 at 12:08:42PM +0300, Okan Sahin wrote:
> This patch adds regulator driver for both MAX77541 and MAX77540.

Read Submitting Patches documentation on how to create better commit message.

> The MAX77541 is a high-efficiency step-down converter
> with two 3A switching phases for single-cell Li+ battery and 5VDC systems.
>
> The MAX77540 is a high-efficiency step-down converter
> with two 3A switching phases.

...

> +/*
> + * Copyright (c) 2022 Analog Devices, Inc.
> + * ADI Regulator driver for the MAX77540 and MAX77541

> + *

Redundant blank line.

> + */

...

> +static const unsigned int max77541_buck_volt_range_sel[] = {
> + 0x00, 0x00, 0x40, 0x40, 0x80, 0x80

You can leave trailing comma.

> +};

...

> +static const struct regulator_desc max77540_regulators_desc[] = {
> + MAX77540_BUCK(1, max77541_buck_ops),
> + MAX77540_BUCK(2, max77541_buck_ops)

Ditto.

> +};
> +
> +static const struct regulator_desc max77541_regulators_desc[] = {
> + MAX77541_BUCK(1, max77541_buck_ops),
> + MAX77541_BUCK(2, max77541_buck_ops)

Ditto.

> +};

...

> +struct max77541_regulator_dev {
> + struct device *dev;

Isn't it the same as...

> + struct max77541_dev *max77541;

...max77541->dev ?

> +};

...

> +static int max77541_regulator_probe(struct platform_device *pdev)
> +{

truct device *dev = &pdev->dev;

will save you a bit of code below.

> + struct max77541_dev *max77541 = dev_get_drvdata(pdev->dev.parent);


...


> + return dev_err_probe(&pdev->dev, PTR_ERR(rdev),
> + "Failed to register regulator\n");

Wrong indentation.

...

> + return dev_err_probe(&pdev->dev, PTR_ERR(rdev),
> + "Failed to register regulator\n");

Ditto.

...

> +

Redundant blank line.

> +module_platform_driver(max77541_regulator_driver);

--
With Best Regards,
Andy Shevchenko