treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / drivers / media / dvb-frontends / zd1301_demod.h
blobd56196f5c80170063e77ccbd0d5b79aadc5ba0c2
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*
3 * ZyDAS ZD1301 driver (demodulator)
5 * Copyright (C) 2015 Antti Palosaari <crope@iki.fi>
6 */
8 #ifndef ZD1301_DEMOD_H
9 #define ZD1301_DEMOD_H
11 #include <linux/platform_device.h>
12 #include <linux/dvb/frontend.h>
13 #include <media/dvb_frontend.h>
15 /**
16 * struct zd1301_demod_platform_data - Platform data for the zd1301_demod driver
17 * @reg_priv: First argument of reg_read and reg_write callbacks.
18 * @reg_read: Register read callback.
19 * @reg_write: Register write callback.
21 struct zd1301_demod_platform_data {
22 void *reg_priv;
23 int (*reg_read)(void *, u16, u8 *);
24 int (*reg_write)(void *, u16, u8);
27 #if IS_REACHABLE(CONFIG_DVB_ZD1301_DEMOD)
28 /**
29 * zd1301_demod_get_dvb_frontend() - Get pointer to DVB frontend
30 * @pdev: Pointer to platform device
32 * Return: Pointer to DVB frontend which given platform device owns.
34 struct dvb_frontend *zd1301_demod_get_dvb_frontend(struct platform_device *pdev);
36 /**
37 * zd1301_demod_get_i2c_adapter() - Get pointer to I2C adapter
38 * @pdev: Pointer to platform device
40 * Return: Pointer to I2C adapter which given platform device owns.
42 struct i2c_adapter *zd1301_demod_get_i2c_adapter(struct platform_device *pdev);
44 #else
46 /**
47 * zd1301_demod_get_dvb_frontend() - Attach a zd1301 frontend
48 * @dev: Pointer to platform device
50 * Return: Pointer to %struct dvb_frontend or NULL if attach fails.
52 static inline struct dvb_frontend *zd1301_demod_get_dvb_frontend(struct platform_device *dev)
54 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
56 return NULL;
58 static inline struct i2c_adapter *zd1301_demod_get_i2c_adapter(struct platform_device *dev)
60 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
62 return NULL;
65 #endif
67 #endif /* ZD1301_DEMOD_H */