Re: [PATCH 4/6] pinctrl: sprd: Add pinctrl support for UMS512

Andy Shevchenko
2023-08-25T10:19:24Z

On Fri, Aug 25, 2023 at 11:18:24AM +0800, Linhua Xu wrote:
> From: Linhua Xu <Linhua.Xu@unisoc.com>
>
> This patch adds the pin control driver for UNISOC UMS512 platform.

Read "Submitting Patches" documentation and find there what to do
with "This patch..."

...

> +config PINCTRL_SPRD_UMS512
> + tristate "Spreadtrum ums512 pinctrl driver"

> + depends on OF

Shouldn't you drop this from all drivers you have? I do not see this driver
being dependent on the OF.

> + depends on ARCH_SPRD || COMPILE_TEST
> + select PINCTRL_SPRD

...

kernel.h for ARRAY_SIZE()

> +#include <linux/module.h>
> +#include <linux/mod_devicetable.h>
> +#include <linux/platform_device.h>

...

> +#define PINCTRL_REG_OFFSET 0x34

0x0034

> +#define PINCTRL_REG_MISC_OFFSET 0x434

> +static int sprd_pinctrl_probe(struct platform_device *pdev)
> +{
> + return sprd_pinctrl_core_probe(pdev, sprd_ums512_pins_info,
> + ARRAY_SIZE(sprd_ums512_pins_info),
> + PINCTRL_REG_OFFSET,
> + PINCTRL_REG_MISC_OFFSET);
> +}

...

> +static const struct of_device_id sprd_pinctrl_of_match[] = {
> + {
> + .compatible = "sprd,ums512-pinctrl",
> + },

Can be one line.

> + { },

Drop trailing comma in the terminator entry.

> +};

...

> +static struct platform_driver sprd_pinctrl_driver = {
> + .driver = {
> + .name = "sprd-pinctrl",
> + .of_match_table = sprd_pinctrl_of_match,
> + },
> + .probe = sprd_pinctrl_probe,
> + .remove = sprd_pinctrl_remove,
> + .shutdown = sprd_pinctrl_shutdown,
> +};

> +

Redundant blank line.

> +module_platform_driver(sprd_pinctrl_driver);

--
With Best Regards,
Andy Shevchenko