Re: [PATCH 2/4] i2c: Add Congatec CGEB I2C driver

From: Wolfram Sang
Date: Fri Jun 12 2015 - 07:05:54 EST



Oh, this one again. Like last time, close to be ready.

> +#include <linux/module.h>
> +#include <linux/platform_device.h>
> +#include <linux/slab.h>
> +#include <linux/i2c.h>
> +#include <linux/mfd/congatec-cgeb.h>

Please sort the includes.

> +struct cgeb_i2c_priv {
> + struct cgeb_board_data *board;
> + struct i2c_adapter adapter;
> + int unit;
> +};

Only a single space for indentation

> + ret = cgeb_i2c_set_speed(priv, 400000);

Not all slaves handle 400kHz. So, this might be a bit demanding. Then
again, it is probably fix which slaves are connected and they work
currently?

> + /*
> + * not a critical error, we can continue with the default speed.
> + */

Single line comment, even if it is a little over 80 chars

> + platform_set_drvdata(pdev, NULL);

Not needed.

> +
> +static struct platform_driver cgeb_i2c_driver = {
> + .probe = cgeb_i2c_probe,
> + .remove = __exit_p(cgeb_i2c_remove),

Leftover annotation?

> + .driver = {
> + .name = "cgeb-i2c",
> + .owner = THIS_MODULE,

Owner not needed

> + },
> +};
> +
> +static int __init cgeb_i2c_driver_init(void)
> +{
> + return platform_driver_register(&cgeb_i2c_driver);
> +}
> +
> +static void __exit cgeb_i2c_driver_exit(void)
> +{
> + platform_driver_unregister(&cgeb_i2c_driver);
> +}
> +
> +module_init(cgeb_i2c_driver_init);
> +module_exit(cgeb_i2c_driver_exit);

module_platform_driver?

> +
> +MODULE_AUTHOR("Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>");
> +MODULE_DESCRIPTION("cgeb i2c driver");
> +MODULE_LICENSE("GPL");

GPL v2

Attachment: signature.asc
Description: Digital signature