treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / sound / soc / codecs / pcm3168a-i2c.c
blob1f75933e74fa236173689c22120d2c0e591d773e
1 // SPDX-License-Identifier: GPL-2.0-only
2 /*
3 * PCM3168A codec i2c driver
5 * Copyright (C) 2015 Imagination Technologies Ltd.
7 * Author: Damien Horsley <Damien.Horsley@imgtec.com>
8 */
10 #include <linux/i2c.h>
11 #include <linux/init.h>
12 #include <linux/module.h>
14 #include <sound/soc.h>
16 #include "pcm3168a.h"
18 static int pcm3168a_i2c_probe(struct i2c_client *i2c,
19 const struct i2c_device_id *id)
21 struct regmap *regmap;
23 regmap = devm_regmap_init_i2c(i2c, &pcm3168a_regmap);
24 if (IS_ERR(regmap))
25 return PTR_ERR(regmap);
27 return pcm3168a_probe(&i2c->dev, regmap);
30 static int pcm3168a_i2c_remove(struct i2c_client *i2c)
32 pcm3168a_remove(&i2c->dev);
34 return 0;
37 static const struct i2c_device_id pcm3168a_i2c_id[] = {
38 { "pcm3168a", },
39 { }
41 MODULE_DEVICE_TABLE(i2c, pcm3168a_i2c_id);
43 static const struct of_device_id pcm3168a_of_match[] = {
44 { .compatible = "ti,pcm3168a", },
45 { }
47 MODULE_DEVICE_TABLE(of, pcm3168a_of_match);
49 static struct i2c_driver pcm3168a_i2c_driver = {
50 .probe = pcm3168a_i2c_probe,
51 .remove = pcm3168a_i2c_remove,
52 .id_table = pcm3168a_i2c_id,
53 .driver = {
54 .name = "pcm3168a",
55 .of_match_table = pcm3168a_of_match,
56 .pm = &pcm3168a_pm_ops,
59 module_i2c_driver(pcm3168a_i2c_driver);
61 MODULE_DESCRIPTION("PCM3168A I2C codec driver");
62 MODULE_AUTHOR("Damien Horsley <Damien.Horsley@imgtec.com>");
63 MODULE_LICENSE("GPL v2");