| .. | .. |
|---|
| 2 | 2 | #include <linux/device.h> |
|---|
| 3 | 3 | #include <linux/kernel.h> |
|---|
| 4 | 4 | #include <linux/module.h> |
|---|
| 5 | +#include <linux/mod_devicetable.h> |
|---|
| 5 | 6 | #include <linux/slab.h> |
|---|
| 6 | 7 | #include <linux/i2c.h> |
|---|
| 7 | 8 | #include <linux/delay.h> |
|---|
| .. | .. |
|---|
| 21 | 22 | |
|---|
| 22 | 23 | regmap = devm_regmap_init_i2c(i2c, &config); |
|---|
| 23 | 24 | if (IS_ERR(regmap)) { |
|---|
| 24 | | - dev_err(&i2c->dev, "Failed to register i2c regmap %d\n", |
|---|
| 25 | | - (int)PTR_ERR(regmap)); |
|---|
| 25 | + dev_err(&i2c->dev, "Failed to register i2c regmap: %pe\n", |
|---|
| 26 | + regmap); |
|---|
| 26 | 27 | return PTR_ERR(regmap); |
|---|
| 27 | 28 | } |
|---|
| 28 | 29 | |
|---|
| .. | .. |
|---|
| 36 | 37 | return kxsd9_common_remove(&client->dev); |
|---|
| 37 | 38 | } |
|---|
| 38 | 39 | |
|---|
| 39 | | -#ifdef CONFIG_OF |
|---|
| 40 | 40 | static const struct of_device_id kxsd9_of_match[] = { |
|---|
| 41 | 41 | { .compatible = "kionix,kxsd9", }, |
|---|
| 42 | 42 | { }, |
|---|
| 43 | 43 | }; |
|---|
| 44 | 44 | MODULE_DEVICE_TABLE(of, kxsd9_of_match); |
|---|
| 45 | | -#else |
|---|
| 46 | | -#define kxsd9_of_match NULL |
|---|
| 47 | | -#endif |
|---|
| 48 | 45 | |
|---|
| 49 | 46 | static const struct i2c_device_id kxsd9_i2c_id[] = { |
|---|
| 50 | 47 | {"kxsd9", 0}, |
|---|
| .. | .. |
|---|
| 55 | 52 | static struct i2c_driver kxsd9_i2c_driver = { |
|---|
| 56 | 53 | .driver = { |
|---|
| 57 | 54 | .name = "kxsd9", |
|---|
| 58 | | - .of_match_table = of_match_ptr(kxsd9_of_match), |
|---|
| 55 | + .of_match_table = kxsd9_of_match, |
|---|
| 59 | 56 | .pm = &kxsd9_dev_pm_ops, |
|---|
| 60 | 57 | }, |
|---|
| 61 | 58 | .probe = kxsd9_i2c_probe, |
|---|