treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / sound / soc / codecs / adau1761-i2c.c
blobc8fce37e5cfa0655f6074d9526e3eb1a0057120b
1 // SPDX-License-Identifier: GPL-2.0-only
2 /*
3 * Driver for ADAU1361/ADAU1461/ADAU1761/ADAU1961 codec
5 * Copyright 2014 Analog Devices Inc.
6 * Author: Lars-Peter Clausen <lars@metafoo.de>
7 */
9 #include <linux/i2c.h>
10 #include <linux/mod_devicetable.h>
11 #include <linux/module.h>
12 #include <linux/regmap.h>
13 #include <sound/soc.h>
15 #include "adau1761.h"
17 static int adau1761_i2c_probe(struct i2c_client *client,
18 const struct i2c_device_id *id)
20 struct regmap_config config;
22 config = adau1761_regmap_config;
23 config.val_bits = 8;
24 config.reg_bits = 16;
26 return adau1761_probe(&client->dev,
27 devm_regmap_init_i2c(client, &config),
28 id->driver_data, NULL);
31 static int adau1761_i2c_remove(struct i2c_client *client)
33 adau17x1_remove(&client->dev);
34 return 0;
37 static const struct i2c_device_id adau1761_i2c_ids[] = {
38 { "adau1361", ADAU1361 },
39 { "adau1461", ADAU1761 },
40 { "adau1761", ADAU1761 },
41 { "adau1961", ADAU1361 },
42 { }
44 MODULE_DEVICE_TABLE(i2c, adau1761_i2c_ids);
46 #if defined(CONFIG_OF)
47 static const struct of_device_id adau1761_i2c_dt_ids[] = {
48 { .compatible = "adi,adau1361", },
49 { .compatible = "adi,adau1461", },
50 { .compatible = "adi,adau1761", },
51 { .compatible = "adi,adau1961", },
52 { },
54 MODULE_DEVICE_TABLE(of, adau1761_i2c_dt_ids);
55 #endif
57 static struct i2c_driver adau1761_i2c_driver = {
58 .driver = {
59 .name = "adau1761",
60 .of_match_table = of_match_ptr(adau1761_i2c_dt_ids),
62 .probe = adau1761_i2c_probe,
63 .remove = adau1761_i2c_remove,
64 .id_table = adau1761_i2c_ids,
66 module_i2c_driver(adau1761_i2c_driver);
68 MODULE_DESCRIPTION("ASoC ADAU1361/ADAU1461/ADAU1761/ADAU1961 CODEC I2C driver");
69 MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>");
70 MODULE_LICENSE("GPL");