IIO: ak8975: Why adding OF compatible string without vendor prefix?
Hi,
I just found the ak8975_of_match table has compatible string without vendor prefix.
static const struct of_device_id ak8975_of_match[] = {
{ .compatible = "asahi-kasei,ak8975", },
{ .compatible = "ak8975", },
{ .compatible = "asahi-kasei,ak8963", },
{ .compatible = "ak8963", },
{ .compatible = "asahi-kasei,ak09911", },
{ .compatible = "ak09911", },
{ .compatible = "asahi-kasei,ak09912", },
{ .compatible = "ak09912", },
{}
};This seems unusual, just curious why below compatible strings are required?
{ .compatible = "ak8975", },
{ .compatible = "ak8963", },
{ .compatible = "ak09911", },
{ .compatible = "ak09912", },Regards,
Axel
Jonathan Cameron
maintainerQuoted 16 lines · Axel Lin
Hi,
I just found theak8975_of_matchtable has compatible string without vendor prefix.static const struct of_device_id ak8975_of_match[] = { { .compatible = "asahi-kasei,ak8975", }, { .compatible = "ak8975", }, { .compatible = "asahi-kasei,ak8963", }, { .compatible = "ak8963", }, { .compatible = "asahi-kasei,ak09911", }, { .compatible = "ak09911", }, { .compatible = "asahi-kasei,ak09912", }, { .compatible = "ak09912", }, {} };
Quoted 9 lines
This seems unusual, just curious why below compatible strings are required?
{ .compatible = "ak8975", }, { .compatible = "ak8963", }, { .compatible = "ak09911", }, { .compatible = "ak09912", },Regards,
Axel
This is an historical artefact. I2C (and for that matter SPI) subsystems handled device tree registration in their cores. Unfortunately they did it by matching against the registered driver names and those don't include vendors.
This is still being unwound, but the upshot is that we have boards with device trees out in the wild using the version without a vendor string. Hence for backwards compatibility, both need to be in the table.
Jonathan