| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | #include <linux/device.h> |
|---|
| 2 | 3 | #include <linux/kernel.h> |
|---|
| 4 | +#include <linux/of.h> |
|---|
| 5 | +#include <linux/of_device.h> |
|---|
| 3 | 6 | #include <linux/spi/spi.h> |
|---|
| 4 | 7 | #include <linux/module.h> |
|---|
| 5 | 8 | #include <linux/slab.h> |
|---|
| .. | .. |
|---|
| 40 | 43 | }; |
|---|
| 41 | 44 | MODULE_DEVICE_TABLE(spi, kxsd9_spi_id); |
|---|
| 42 | 45 | |
|---|
| 46 | +static const struct of_device_id kxsd9_of_match[] = { |
|---|
| 47 | + { .compatible = "kionix,kxsd9" }, |
|---|
| 48 | + { }, |
|---|
| 49 | +}; |
|---|
| 50 | +MODULE_DEVICE_TABLE(of, kxsd9_of_match); |
|---|
| 51 | + |
|---|
| 43 | 52 | static struct spi_driver kxsd9_spi_driver = { |
|---|
| 44 | 53 | .driver = { |
|---|
| 45 | 54 | .name = "kxsd9", |
|---|
| 46 | 55 | .pm = &kxsd9_dev_pm_ops, |
|---|
| 56 | + .of_match_table = kxsd9_of_match, |
|---|
| 47 | 57 | }, |
|---|
| 48 | 58 | .probe = kxsd9_spi_probe, |
|---|
| 49 | 59 | .remove = kxsd9_spi_remove, |
|---|