[PATCH 1/3] ARM: meson: reset: Add reset controller for MesonX SoCs
From: Carlo Caione <hidden>
Date: 2014-10-12 16:10:41
Also in:
linux-devicetree
On Sun, Oct 12, 2014 at 6:03 PM, Beniamino Galvani [off-list ref] wrote:
Hi Carlo,
Hi Beniamino,
quoted
[...] + +static int meson_reset_probe(struct platform_device *pdev) +{ + struct meson_reset_data *data; + struct resource *res; + + /* + * The binding was mainlined without the required property. + * Do not continue, when we encounter an old DT. + */ + if (!of_find_property(pdev->dev.of_node, "#reset-cells", NULL)) { + dev_err(&pdev->dev, "%s missing #reset-cells property\n", + pdev->dev.of_node->full_name); + return -EINVAL; + }Probably the above comment was taken from another driver but is not relevant here.
Right. Lazy copy and paste with brain off
quoted
+ +static int meson_reset_remove(struct platform_device *pdev) +{ + struct meson_reset_data *data = platform_get_drvdata(pdev);Don't you need to call platform_set_drvdata() in the probe() function for this to be valid?
Yes. Even though I believe the remove can never happen.
quoted
+ + reset_controller_unregister(&data->rcdev); + + return 0; +} + +static const struct of_device_id meson_reset_dt_ids[] = { + { .compatible = "amlogic,meson6-rst-mgr-ao", }, + { /* sentinel */ }, +}; + +static struct platform_driver meson_reset_driver = { + .probe = meson_reset_probe, + .remove = meson_reset_remove, + .driver = { + .name = "meson-reset", + .owner = THIS_MODULE,I believe you can drop the owner field.
I will. Thank you for your review, -- Carlo Caione