Re: [PATCH v2 1/4] reset: Add support for the Amlogic Meson SoC Reset Controller

From: Philipp Zabel
Date: Wed May 25 2016 - 06:14:34 EST


Hi Neil,

looks fine, just two comments below.

Am Mittwoch, den 25.05.2016, 11:49 +0200 schrieb Neil Armstrong:
> This patch adds the platform driver for the Amlogic Meson SoC Reset
> Controller.
>
> The Meson8b and GXBB SoCs are supported.
>
> Signed-off-by: Neil Armstrong <narmstrong@xxxxxxxxxxxx>
> ---
> drivers/reset/Makefile | 1 +
> drivers/reset/reset-meson.c | 137 ++++++++++++++++++++++++++++++++++++++++++++
> 2 files changed, 138 insertions(+)
> create mode 100644 drivers/reset/reset-meson.c
>
[...]
> diff --git a/drivers/reset/reset-meson.c b/drivers/reset/reset-meson.c
> new file mode 100644
> index 0000000..98087ae
> --- /dev/null
> +++ b/drivers/reset/reset-meson.c
[...]
> +static int meson_reset_reset(struct reset_controller_dev *rcdev,
> + unsigned long id)
> +{
> + struct meson_reset *data =
> + container_of(rcdev, struct meson_reset, rcdev);
> + unsigned int bank = id / BITS_PER_REG;
> + unsigned int offset = id % BITS_PER_REG;
> + void *reg_addr = data->reg_base + (bank << 2);

We lost the __iomem here.

> +
> + if (bank >= REG_COUNT)
> + return -EINVAL;
> +
> + writel(BIT(offset), reg_addr);
> +
> + return 0;
> +}
> +
> +static const struct reset_control_ops meson_reset_ops = {
> + .reset = meson_reset_reset,
> +};
> +
> +static const struct of_device_id meson_reset_dt_ids[] = {
> + { .compatible = "amlogic,meson8b-reset", },
> + { .compatible = "amlogic,meson-gxbb-reset", },
> + { /* sentinel */ },
> +};
> +MODULE_DEVICE_TABLE(of, meson_reset_dt_ids);
[...]
> +MODULE_ALIAS("platform:meson_reset");

And I think you can drop the MODULE_ALIAS since of: modaliases will be
generated from the MODULE_DEVICE_TABLE above. This driver is only ever
going to be probed from device tree, isn't it?

> +MODULE_AUTHOR("Neil Armstrong <narmstrong@xxxxxxxxxxxx>");
> +MODULE_DESCRIPTION("Amlogic Meson Reset Controller driver");
> +MODULE_LICENSE("Dual BSD/GPL");

regards
Philipp