// Minimal platform driver showing how Linux matches a device-tree node.
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>

static int drhyme_probe(struct platform_device *pdev)
{
	const char *label = "unnamed";

	of_property_read_string(pdev->dev.of_node, "label", &label);
	dev_info(&pdev->dev, "matched device-tree node: %s\n", label);
	return 0;
}

static const struct of_device_id drhyme_of_match[] = {
	{ .compatible = "digital-rhyme,orin-demo" },
	{ }
};
MODULE_DEVICE_TABLE(of, drhyme_of_match);

static struct platform_driver drhyme_driver = {
	.probe = drhyme_probe,
	.driver = {
		.name = "drhyme-dt-demo",
		.of_match_table = drhyme_of_match,
	},
};
module_platform_driver(drhyme_driver);

MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Device-tree platform-driver match example");
