Re: [PATCH 2/3] leds: as3645a: Add LED flash class driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Hello Sakari,

I haven't looked at the driver, but just have a comment about the I2C subsystem.

On Wed, Aug 16, 2017 at 2:55 PM, Sakari Ailus
<sakari.ailus@xxxxxxxxxxxxxxx> wrote:

[snip]

> +
> +static const struct of_device_id as3645a_of_table[] = {
> +       { .compatible = "ams,as3645a" },
> +       { },
> +};
> +MODULE_DEVICE_TABLE(of, as3645a_of_table);
> +
> +SIMPLE_DEV_PM_OPS(as3645a_pm_ops, as3645a_resume, as3645a_suspend);
> +
> +static struct i2c_driver as3645a_i2c_driver = {
> +       .driver = {
> +               .of_match_table = as3645a_of_table,
> +               .name = AS_NAME,
> +               .pm   = &as3645a_pm_ops,
> +       },
> +       .probe_new      = as3645a_probe,
> +       .remove = as3645a_remove,
> +};
> +
> +module_i2c_driver(as3645a_i2c_driver);
> +

The I2C core is still broken w.r.t reporting a proper MODALIAS for OF
registered devices, it will report a MODALIAS=i2c:as3645a in this
case. So if you build this as a module, autoload won't work.

In theory this will be fixed soon, but for now you should add a
i2c_device_id table and export it with MODULE_DEVICE_TABLE(i2c,...) if
you care about module autoloading.

Best regards,
Javier
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux