Re: [PATCH v2 2/3] power: supply: add ChromeOS EC based charge control driver
From: Sebastian Reichel
Date: Wed Jun 05 2024 - 18:15:32 EST
Hi,
On Tue, May 28, 2024 at 10:04:11PM +0200, Thomas Weißschuh wrote:
> + battery_hook_register(&priv->battery_hook);
> +
> + platform_set_drvdata(pdev, priv);
> +
> + return 0;
> +}
> +
> +static int cros_chctl_remove(struct platform_device *pdev)
> +{
> + struct cros_chctl_priv *priv = platform_get_drvdata(pdev);
> +
> + battery_hook_unregister(&priv->battery_hook);
> +
> + return 0;
> +}
Please use devm_add_action_or_reset() or introduce
devm_battery_hook_register(), which could also be used by
dell-wmi-ddv. Otherwise LGTM.
-- Sebastian
> +
> +static const struct platform_device_id cros_chctl_id[] = {
> + { DRV_NAME, 0 },
> + { }
> +};
> +
> +static struct platform_driver cros_chctl_driver = {
> + .driver.name = DRV_NAME,
> + .probe = cros_chctl_probe,
> + .remove = cros_chctl_remove,
> + .id_table = cros_chctl_id,
> +};
> +module_platform_driver(cros_chctl_driver);
> +
> +MODULE_DEVICE_TABLE(platform, cros_chctl_id);
> +MODULE_DESCRIPTION("ChromeOS EC charge control");
> +MODULE_AUTHOR("Thomas Weißschuh <linux@xxxxxxxxxxxxxx>");
> +MODULE_LICENSE("GPL");
>
> --
> 2.45.1
>
Attachment:
signature.asc
Description: PGP signature